Class: Io::Flow::V0::Models::OrganizationDefaults

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrganizationDefaults

Returns a new instance of OrganizationDefaults.



41380
41381
41382
41383
41384
41385
41386
41387
41388
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41380

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:country, :base_currency, :language, :locale, :timezone], 'OrganizationDefaults')
  @country = HttpClient::Preconditions.assert_class('country', opts.delete(:country), String)
  @base_currency = HttpClient::Preconditions.assert_class('base_currency', opts.delete(:base_currency), String)
  @language = HttpClient::Preconditions.assert_class('language', opts.delete(:language), String)
  @locale = HttpClient::Preconditions.assert_class('locale', opts.delete(:locale), String)
  @timezone = HttpClient::Preconditions.assert_class('timezone', opts.delete(:timezone), String)
end

Instance Attribute Details

#base_currencyObject (readonly)

Returns the value of attribute base_currency.



41378
41379
41380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41378

def base_currency
  @base_currency
end

#countryObject (readonly)

Returns the value of attribute country.



41378
41379
41380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41378

def country
  @country
end

#languageObject (readonly)

Returns the value of attribute language.



41378
41379
41380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41378

def language
  @language
end

#localeObject (readonly)

Returns the value of attribute locale.



41378
41379
41380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41378

def locale
  @locale
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



41378
41379
41380
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41378

def timezone
  @timezone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



41394
41395
41396
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41394

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

#to_hashObject



41398
41399
41400
41401
41402
41403
41404
41405
41406
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41398

def to_hash
  {
    :country => country,
    :base_currency => base_currency,
    :language => language,
    :locale => locale,
    :timezone => timezone
  }
end

#to_jsonObject



41390
41391
41392
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 41390

def to_json
  JSON.dump(to_hash)
end