Class: HN::Client
Constant Summary
HN::Configuration::DEFAULT_API_URL, HN::Configuration::DEFAULT_HEADERS, HN::Configuration::VALID_CONFIGURATION_KEYS
Instance Method Summary
collapse
#configure, #reset
Methods included from Request
#get
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
11
12
13
|
# File 'lib/hn/client.rb', line 11
def initialize
reset
end
|
Instance Method Details
#item(id, options = {}) ⇒ Object
15
16
17
|
# File 'lib/hn/client.rb', line 15
def item(id, options = {})
get("item/#{id}.json", options)
end
|
#max_item(options = {}) ⇒ Object
27
28
29
|
# File 'lib/hn/client.rb', line 27
def max_item(options = {})
get('maxitem.json', options)
end
|
#top_stories(options = {}) ⇒ Object
23
24
25
|
# File 'lib/hn/client.rb', line 23
def top_stories(options = {})
get('topstories.json', options)
end
|
#updates(options = {}) ⇒ Object
31
32
33
|
# File 'lib/hn/client.rb', line 31
def updates(options = {})
get('updates.json', options)
end
|
#user(id, options = {}) ⇒ Object
19
20
21
|
# File 'lib/hn/client.rb', line 19
def user(id, options = {})
get("user/#{id}.json", options)
end
|