Class: Brightpearl::Currency
- Defined in:
- lib/brightpearl/resources/currency.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#exchange_rate ⇒ Object
Returns the value of attribute exchange_rate.
-
#exchange_rate_variance_nominal_code ⇒ Object
Returns the value of attribute exchange_rate_variance_nominal_code.
-
#id ⇒ Object
Returns the value of attribute id.
-
#is_default ⇒ Object
Returns the value of attribute is_default.
-
#symbol ⇒ Object
Returns the value of attribute symbol.
-
#title ⇒ Object
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(ara) ⇒ Currency
constructor
ARA => API Record Array.
Methods inherited from Resource
Constructor Details
#initialize(ara) ⇒ Currency
ARA => API Record Array
17 18 19 20 21 22 23 24 25 |
# File 'lib/brightpearl/resources/currency.rb', line 17 def initialize(ara) @id = ara[0] @title = ara[1] @code = ara[2] @symbol = ara[3] @exchange_rate = ara[4] @is_default = ara[5] @exchange_rate_variance_nominal_code = ara[6] end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def code @code end |
#exchange_rate ⇒ Object
Returns the value of attribute exchange_rate.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def exchange_rate @exchange_rate end |
#exchange_rate_variance_nominal_code ⇒ Object
Returns the value of attribute exchange_rate_variance_nominal_code.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def exchange_rate_variance_nominal_code @exchange_rate_variance_nominal_code end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def id @id end |
#is_default ⇒ Object
Returns the value of attribute is_default.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def is_default @is_default end |
#symbol ⇒ Object
Returns the value of attribute symbol.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def symbol @symbol end |
#title ⇒ Object
Returns the value of attribute title.
3 4 5 |
# File 'lib/brightpearl/resources/currency.rb', line 3 def title @title end |
Class Method Details
.search(query_params = {}) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/brightpearl/resources/currency.rb', line 8 def search(query_params = {}) response = send_request(path: "accounting-service/currency-search?#{to_query(query_params)}", method: :get) response.merge({ records: response[:payload]["response"]["results"].map { |item| Currency.new(item) } }) end |