Class: Exchange::ExternalAPI::XML

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

Overview

The xml base class takes care of XML apis. It assumes you would want to use nokogiri as a parser and preloads the gem Also, this may serve as a base for some operations which might be common to the xml apis

Author:

  • Beat Richartz

Since:

  • 0.6

Version:

  • 0.6

Direct Known Subclasses

Ecb, XavierMedia

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) ⇒ XML

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

Since:

  • 0.6


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

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