Class: KaveRestApi::Info
- Inherits:
-
RequestBase
- Object
- RequestBase
- KaveRestApi::Info
- Defined in:
- lib/kavenegar-ruby/requests/info.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(args = {}) ⇒ Info
constructor
A new instance of Info.
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
#call ⇒ Object
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 |