Class: Hahamut::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/hahamut/client.rb

Overview

Hahamut Client

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (readonly)

Returns the value of attribute id.



6
7
8
# File 'lib/hahamut/client.rb', line 6

def id
  @id
end

#secretObject (readonly)

Returns the value of attribute secret.



6
7
8
# File 'lib/hahamut/client.rb', line 6

def secret
  @secret
end

#senderObject (readonly)

Returns the value of attribute sender.



6
7
8
# File 'lib/hahamut/client.rb', line 6

def sender
  @sender
end

#tokenObject (readonly)

Returns the value of attribute token.



6
7
8
# File 'lib/hahamut/client.rb', line 6

def token
  @token
end

#uploaderObject (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, message)
  @sender.send(recipient, message)
end

#upload(path) ⇒ Object



22
23
24
# File 'lib/hahamut/client.rb', line 22

def upload(path)
  @uploader.upload(path)
end