Class: Monobank::Methods::Base
- Inherits:
-
Object
- Object
- Monobank::Methods::Base
- Defined in:
- lib/monobank/methods/base.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(auth: nil) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(auth: nil) ⇒ Base
Returns a new instance of Base.
6 7 8 |
# File 'lib/monobank/methods/base.rb', line 6 def initialize(auth: nil) @auth = auth end |
Instance Method Details
#call ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/monobank/methods/base.rb', line 10 def call http_response = response attributes = http_response.parsed_response return define_resources(attributes) if http_response.code == 200 Monobank::Resources::Error.new(attributes.merge('code' => http_response.code)) end |