Class: Dog::TestConnection

Inherits:
Object
  • Object
show all
Defined in:
lib/dog/test_connection.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(client = nil) ⇒ TestConnection

Returns a new instance of TestConnection.



5
6
7
8
# File 'lib/dog/test_connection.rb', line 5

def initialize(client=nil)
  @joined_rooms = []
  @sent_messages = []
end

Instance Attribute Details

#joined_roomsObject (readonly)

Returns the value of attribute joined_rooms.



3
4
5
# File 'lib/dog/test_connection.rb', line 3

def joined_rooms
  @joined_rooms
end

#sent_messagesObject (readonly)

Returns the value of attribute sent_messages.



3
4
5
# File 'lib/dog/test_connection.rb', line 3

def sent_messages
  @sent_messages
end

Instance Method Details

#join(room_name) ⇒ Object



10
11
12
# File 'lib/dog/test_connection.rb', line 10

def join(room_name)
  @joined_rooms << room_name
end

#say(to, text) ⇒ Object



14
15
16
# File 'lib/dog/test_connection.rb', line 14

def say(to, text)
  @sent_messages << [to, text]
end

#say_to_chat(to, text) ⇒ Object



18
19
20
# File 'lib/dog/test_connection.rb', line 18

def say_to_chat(to, text)
  @sent_messages << [to, text]
end