Class: Io::Flow::V0::Models::CurrencySymbols

Inherits:
Object
  • Object
show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Defines one or more symbols representing this currency

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ CurrencySymbols

Returns a new instance of CurrencySymbols.



11342
11343
11344
11345
11346
11347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11342

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:primary], 'CurrencySymbols')
  @primary = HttpClient::Preconditions.assert_class('primary', opts.delete(:primary), String)
  @narrow = (x = opts.delete(:narrow); x.nil? ? nil : HttpClient::Preconditions.assert_class('narrow', x, String))
end

Instance Attribute Details

#narrow ⇒ Object (readonly)

Returns the value of attribute narrow.



11340
11341
11342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11340

def narrow
  @narrow
end

#primary ⇒ Object (readonly)

Returns the value of attribute primary.



11340
11341
11342
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11340

def primary
  @primary
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



11353
11354
11355
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11353

def copy(incoming={})
  CurrencySymbols.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#to_hash ⇒ Object



11357
11358
11359
11360
11361
11362
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11357

def to_hash
  {
    :primary => primary,
    :narrow => narrow
  }
end

#to_json ⇒ Object



11349
11350
11351
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 11349

def to_json
  JSON.dump(to_hash)
end