Class: Dog::TestConnection
- Inherits:
-
Object
- Object
- Dog::TestConnection
- Defined in:
- lib/dog/test_connection.rb
Instance Attribute Summary collapse
-
#joined_rooms ⇒ Object
readonly
Returns the value of attribute joined_rooms.
-
#sent_messages ⇒ Object
readonly
Returns the value of attribute sent_messages.
Instance Method Summary collapse
-
#initialize(client = nil) ⇒ TestConnection
constructor
A new instance of TestConnection.
- #join(room_name) ⇒ Object
- #say(to, text) ⇒ Object
- #say_to_chat(to, text) ⇒ Object
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_rooms ⇒ Object (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_messages ⇒ Object (readonly)
Returns the value of attribute sent_messages.
3 4 5 |
# File 'lib/dog/test_connection.rb', line 3 def @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 |