Class: DesignerNews::Client
- Inherits:
-
Object
- Object
- DesignerNews::Client
- Includes:
- Authentication, Comments, Motds, Stories, Users, Configurable, Connection
- Defined in:
- lib/designer_news/client.rb,
lib/designer_news/client/motds.rb,
lib/designer_news/client/users.rb,
lib/designer_news/client/stories.rb,
lib/designer_news/client/comments.rb
Defined Under Namespace
Modules: Comments, Motds, Stories, Users
Instance Attribute Summary
Attributes included from Configurable
#access_token, #api_endpoint, #middleware, #user_agent
Instance Method Summary collapse
- #delete(url, options = {}) ⇒ Object
- #get(url, options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #post(url, options = {}) ⇒ Object
- #put(url, options = {}) ⇒ Object
Methods included from Motds
#downvote_motd, #motd, #upvote_motd
Methods included from Comments
#comment, #reply_to_comment, #upvote_comment
Methods included from Stories
#recent_stories, #reply_to_story, #search_stories, #stories, #story, #upvote_story
Methods included from Users
Methods included from Connection
Methods included from Configurable
Methods included from Authentication
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
33 34 35 36 37 |
# File 'lib/designer_news/client.rb', line 33 def initialize(={}) DesignerNews::Configurable.keys.each do |key| instance_variable_set(:"@#{key}", [key] || DesignerNews.instance_variable_get(:"@#{key}")) end end |
Instance Method Details
#delete(url, options = {}) ⇒ Object
51 52 53 |
# File 'lib/designer_news/client.rb', line 51 def delete(url, = {}) request :delete, url, end |
#get(url, options = {}) ⇒ Object
39 40 41 |
# File 'lib/designer_news/client.rb', line 39 def get(url, = {}) request :get, url, end |
#post(url, options = {}) ⇒ Object
43 44 45 |
# File 'lib/designer_news/client.rb', line 43 def post(url, = {}) request :post, url, end |
#put(url, options = {}) ⇒ Object
47 48 49 |
# File 'lib/designer_news/client.rb', line 47 def put(url, = {}) request :put, url, end |