Class: Exchange::ExternalAPI::Json

Inherits:
Base
  • Object
show all
Defined in:
lib/exchange/external_api/json.rb

Overview

The json base class takes care of JSON apis. This may serve as a base for some operations which might be common to the json apis

Author:

  • Beat Richartz

Since:

  • 0.6

Version:

  • 0.6

Instance Attribute Summary

Attributes inherited from Base

#base, #cache, #helper, #rates, #timestamp

Instance Method Summary collapse

Methods inherited from Base

#convert, #rate, #test_for_rates_and_raise_if_nil, #to_hash!

Constructor Details

#initialize(*args) ⇒ Json

Initializer, essentially takes the arguments passed to initialization, loads json on the way and passes the arguments to the api base

Since:

  • 0.6


16
17
18
19
# File 'lib/exchange/external_api/json.rb', line 16

def initialize *args
  Exchange::GemLoader.new('json').try_load unless defined?(JSON)
  super *args
end