Class: Twi::Mock::Conversation
- Inherits:
-
Conversation
- Object
- Resource
- Conversation
- Twi::Mock::Conversation
- Defined in:
- lib/twi/mock/conversation.rb
Instance Attribute Summary
Attributes inherited from Conversation
Instance Method Summary collapse
- #close ⇒ Object
- #create_message(content:, image_ids: []) ⇒ Object
- #create_with(participants:) ⇒ Object
- #delete ⇒ Object
- #rename(friendly_name) ⇒ Object
- #upload(file) ⇒ Object
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twi::Resource
Instance Method Details
#close ⇒ Object
21 |
# File 'lib/twi/mock/conversation.rb', line 21 def close; end |
#create_message(content:, image_ids: []) ⇒ Object
25 26 27 |
# File 'lib/twi/mock/conversation.rb', line 25 def (content:, image_ids: []) Mock::Message.new Twi.mock. end |
#create_with(participants:) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/twi/mock/conversation.rb', line 3 def create_with(participants:) if Twi.mock.conversation_error if Twi.mock.conversation_error[:code] == 50438 raise ExistingConversationError.new(Twi.mock.conversation_error[:message]) elsif Twi.mock.conversation_error[:code] == 50214 Twi.mock.conversation_error = nil raise TooManyConversationsError end elsif Twi.mock.conversation @id = Twi.mock.conversation[:id] @status = Twi.mock.conversation[:status] end end |
#delete ⇒ Object
23 |
# File 'lib/twi/mock/conversation.rb', line 23 def delete; end |
#rename(friendly_name) ⇒ Object
19 |
# File 'lib/twi/mock/conversation.rb', line 19 def rename(friendly_name); end |
#upload(file) ⇒ Object
17 |
# File 'lib/twi/mock/conversation.rb', line 17 def upload(file) = 'fake-sid' |