Class: YamWow::Client
- Inherits:
-
Object
- Object
- YamWow::Client
- Defined in:
- lib/yamwow/client.rb
Instance Method Summary collapse
- #get_autocomplete(params = {}) ⇒ Object
- #get_current_user ⇒ Object
- #get_messages_about_topic(topic_id, params = {}) ⇒ Object
- #get_topic(topic_id) ⇒ Object
-
#initialize(access_token) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(access_token) ⇒ Client
Returns a new instance of Client.
7 8 9 10 11 12 13 14 |
# File 'lib/yamwow/client.rb', line 7 def initialize(access_token) @yam = Yam.new access_token, nil @throttles = { messages: Throttle.new(10, 30), autocomplete: Throttle.new(10, 10), other: Throttle.new(10, 10) } end |
Instance Method Details
#get_autocomplete(params = {}) ⇒ Object
16 17 18 |
# File 'lib/yamwow/client.rb', line 16 def get_autocomplete(params={}) get 'autocomplete.json', params end |
#get_current_user ⇒ Object
20 21 22 |
# File 'lib/yamwow/client.rb', line 20 def get_current_user get 'users/current.json' end |
#get_messages_about_topic(topic_id, params = {}) ⇒ Object
24 25 26 |
# File 'lib/yamwow/client.rb', line 24 def (topic_id, params={}) get "messages/about_topic/#{topic_id}.json", params end |
#get_topic(topic_id) ⇒ Object
28 29 30 |
# File 'lib/yamwow/client.rb', line 28 def get_topic(topic_id) get "topics/#{topic_id}.json" end |