Class: Imgurapi::Communication

Inherits:
Struct
  • Object
show all
Defined in:
lib/imgurapi/communication.rb

Constant Summary collapse

API_VERSION =
3
MAX_ATTEMPTS =
3

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sessionObject

Returns the value of attribute session

Returns:

  • (Object)

    the current value of 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