Class: KaveRestApi::Info

Inherits:
RequestBase show all
Defined in:
lib/kavenegar-ruby/requests/info.rb

Instance Method Summary collapse

Constructor Details

#initialize(args = {}) ⇒ Info

Returns a new instance of Info.



3
4
5
6
# File 'lib/kavenegar-ruby/requests/info.rb', line 3

def initialize(args = {})
  @ACTION_NAME    = [:info,@FORMAT].join('.').freeze
  @response     = ResponseInfo.new
end

Instance Method Details

#callObject



8
9
10
11
12
13
14
15
# File 'lib/kavenegar-ruby/requests/info.rb', line 8

def call
    connection = Faraday.new(url: "#{API_URL}/account/") do |faraday|
      faraday.adapter Faraday.default_adapter
      faraday.response FORMAT.to_sym
    end
     response = connection.get(@ACTION_NAME)
     @response.validate(response.body)
end