Class: Imgurapi::Communication
- Inherits:
-
Struct
- Object
- Struct
- Imgurapi::Communication
- Defined in:
- lib/imgurapi/communication.rb
Constant Summary collapse
- API_VERSION =
3
- MAX_ATTEMPTS =
3
Instance Attribute Summary collapse
-
#session ⇒ Object
Returns the value of attribute session.
Instance Method Summary collapse
-
#call(method, endpoint, params = nil) ⇒ Object
RESTful network call.
Instance Attribute Details
#session ⇒ Object
Returns the value of attribute session
2 3 4 |
# File 'lib/imgurapi/communication.rb', line 2 def session @session end |
Instance Method Details
#call(method, endpoint, params = nil) ⇒ Object
RESTful network call
8 9 10 11 12 |
# File 'lib/imgurapi/communication.rb', line 8 def call(method, endpoint, params = nil) request do session.connection.send method, "/#{API_VERSION}/#{endpoint}.json", params end end |