Class: Twi::Mock::Conversation

Inherits:
Conversation show all
Defined in:
lib/twi/mock/conversation.rb

Instance Attribute Summary

Attributes inherited from Conversation

#id, #status

Instance Method Summary collapse

Methods inherited from Conversation

#url

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from Twi::Resource

Instance Method Details

#closeObject



20
# File 'lib/twi/mock/conversation.rb', line 20

def close; end

#create_message(content:, image_ids: []) ⇒ Object



24
25
26
# File 'lib/twi/mock/conversation.rb', line 24

def create_message(content:, image_ids: [])
  Mock::Message.new Twi.mock.message
end

#create_with(participants:) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/twi/mock/conversation.rb', line 3

def create_with(participants:)
  if error = Twi.mock.conversation_error
    Twi.mock.conversation_error = nil
    case error[:code]
      when 50438 then raise ExistingConversationError.new(error)
      when 50214 then raise TooManyConversationsError.new(error)
    end
  elsif Twi.mock.conversation
    @id = Twi.mock.conversation[:id]
    @status = Twi.mock.conversation[:status]
  end
end

#deleteObject



22
# File 'lib/twi/mock/conversation.rb', line 22

def delete; end

#rename(friendly_name) ⇒ Object



18
# File 'lib/twi/mock/conversation.rb', line 18

def rename(friendly_name); end

#upload(file) ⇒ Object



16
# File 'lib/twi/mock/conversation.rb', line 16

def upload(file) = 'fake-sid'