Class: Io::Flow::V0::Models::LocaleNumbers

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

Overview

Number formats defined for a given locale

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ LocaleNumbers

Returns a new instance of LocaleNumbers.



36562
36563
36564
36565
36566
36567
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36562

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:decimal, :group], 'LocaleNumbers')
  @decimal = HttpClient::Preconditions.assert_class('decimal', opts.delete(:decimal), String)
  @group = HttpClient::Preconditions.assert_class('group', opts.delete(:group), String)
end

Instance Attribute Details

#decimalObject (readonly)

Returns the value of attribute decimal.



36560
36561
36562
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36560

def decimal
  @decimal
end

#groupObject (readonly)

Returns the value of attribute group.



36560
36561
36562
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36560

def group
  @group
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



36573
36574
36575
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36573

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

#to_hashObject



36577
36578
36579
36580
36581
36582
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36577

def to_hash
  {
    :decimal => decimal,
    :group => group
  }
end

#to_jsonObject



36569
36570
36571
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36569

def to_json
  JSON.dump(to_hash)
end