Class: Hahamut::Client
- Inherits:
-
Object
- Object
- Hahamut::Client
- Defined in:
- lib/hahamut/client.rb
Overview
Hahamut Client
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#sender ⇒ Object
readonly
Returns the value of attribute sender.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#uploader ⇒ Object
readonly
Returns the value of attribute uploader.
Instance Method Summary collapse
-
#initialize(bot_id, token, secret) ⇒ Client
constructor
A new instance of Client.
- #send_to(recipient, message) ⇒ Object
- #upload(path) ⇒ Object
Constructor Details
#initialize(bot_id, token, secret) ⇒ Client
Returns a new instance of Client.
8 9 10 11 12 13 14 15 16 |
# File 'lib/hahamut/client.rb', line 8 def initialize(bot_id, token, secret) @id = bot_id @token = token @secret = secret @sender = Sender.new(@token) @uploader = Uploader.new(@id, @token) Manager.register(self) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
6 7 8 |
# File 'lib/hahamut/client.rb', line 6 def id @id end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
6 7 8 |
# File 'lib/hahamut/client.rb', line 6 def secret @secret end |
#sender ⇒ Object (readonly)
Returns the value of attribute sender.
6 7 8 |
# File 'lib/hahamut/client.rb', line 6 def sender @sender end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
6 7 8 |
# File 'lib/hahamut/client.rb', line 6 def token @token end |
#uploader ⇒ Object (readonly)
Returns the value of attribute uploader.
6 7 8 |
# File 'lib/hahamut/client.rb', line 6 def uploader @uploader end |
Instance Method Details
#send_to(recipient, message) ⇒ Object
18 19 20 |
# File 'lib/hahamut/client.rb', line 18 def send_to(recipient, ) @sender.send(recipient, ) end |
#upload(path) ⇒ Object
22 23 24 |
# File 'lib/hahamut/client.rb', line 22 def upload(path) @uploader.upload(path) end |