Class: Bearychat::RTM
- Inherits:
-
Object
- Object
- Bearychat::RTM
- Defined in:
- lib/bearychat/rtm.rb
Constant Summary collapse
- MESSAGE_URL =
"https://rtm.bearychat.com/message"
Instance Attribute Summary collapse
-
#http_client ⇒ Object
Returns the value of attribute http_client.
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token) ⇒ RTM
constructor
A new instance of RTM.
- #send(message) ⇒ Object
Constructor Details
#initialize(token) ⇒ RTM
Returns a new instance of RTM.
10 11 12 13 |
# File 'lib/bearychat/rtm.rb', line 10 def initialize(token) self.http_client = HttpClient.new(MESSAGE_URL) self.token = token end |
Instance Attribute Details
#http_client ⇒ Object
Returns the value of attribute http_client.
8 9 10 |
# File 'lib/bearychat/rtm.rb', line 8 def http_client @http_client end |
#token ⇒ Object
Returns the value of attribute token.
8 9 10 |
# File 'lib/bearychat/rtm.rb', line 8 def token @token end |
Instance Method Details
#send(message) ⇒ Object
15 16 17 |
# File 'lib/bearychat/rtm.rb', line 15 def send() http_client.post_json({ token: token }.merge().to_json) end |