Class: Fabriq::Skype::Room
- Inherits:
-
Object
- Object
- Fabriq::Skype::Room
- Defined in:
- lib/fabriq/skype/room.rb
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#id ⇒ Object
Returns the value of attribute id.
-
#members ⇒ Object
Returns the value of attribute members.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#topic ⇒ Object
Returns the value of attribute topic.
Instance Method Summary collapse
- #build_message_from_string(body, opts = {}) ⇒ Object
-
#initialize(adapter, id, members, raw) ⇒ Room
constructor
A new instance of Room.
- #private_session? ⇒ Boolean
- #send_message(body, opts = {}) ⇒ Object
Constructor Details
#initialize(adapter, id, members, raw) ⇒ Room
Returns a new instance of Room.
7 8 9 10 11 12 |
# File 'lib/fabriq/skype/room.rb', line 7 def initialize(adapter, id, members, raw) @adapter = adapter @id = id @members = members @raw = raw end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
5 6 7 |
# File 'lib/fabriq/skype/room.rb', line 5 def adapter @adapter end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/fabriq/skype/room.rb', line 5 def id @id end |
#members ⇒ Object
Returns the value of attribute members.
5 6 7 |
# File 'lib/fabriq/skype/room.rb', line 5 def members @members end |
#raw ⇒ Object
Returns the value of attribute raw.
5 6 7 |
# File 'lib/fabriq/skype/room.rb', line 5 def raw @raw end |
#topic ⇒ Object
Returns the value of attribute topic.
5 6 7 |
# File 'lib/fabriq/skype/room.rb', line 5 def topic @topic end |
Instance Method Details
#build_message_from_string(body, opts = {}) ⇒ Object
23 24 25 26 |
# File 'lib/fabriq/skype/room.rb', line 23 def (body, opts = {}) body = "@%s: %s" % [opts[:to], body] if opts[:to] && !private_session? Fabriq::Skype::Message.new(self, body) end |
#private_session? ⇒ Boolean
14 15 16 |
# File 'lib/fabriq/skype/room.rb', line 14 def private_session? @members.count == 2 end |
#send_message(body, opts = {}) ⇒ Object
18 19 20 21 |
# File 'lib/fabriq/skype/room.rb', line 18 def (body, opts = {}) = (body, opts) @adapter.() end |