Class: Insightly::Currency

Inherits:
ReadOnly show all
Defined in:
lib/insightly/currency.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ReadOnly

#==, build, #config, #get_collection, #initialize, #process, #remote_data

Methods inherited from Base

#==, all, api_field, build, #config, custom_fields, #get_collection, #initialize, #load, #process, #reload, #remote_data, #remote_id, #to_json, #url_base

Constructor Details

This class inherits a constructor from Insightly::ReadOnly

Class Method Details

.canadaObject



18
19
20
# File 'lib/insightly/currency.rb', line 18

def self.canada
  self.build("CAD")
end

.usObject



15
16
17
# File 'lib/insightly/currency.rb', line 15

def self.us
  self.build("USD")
end

Instance Method Details

#build(data) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/insightly/currency.rb', line 7

def build(data)
  if data.respond_to? :keys
    @data = data
  else
    @data = {"CURRENCY_CODE" => data, "CURRENCY_SYMBOL" => "$"}
  end
  self
end