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.



37287
37288
37289
37290
37291
37292
37293
37294
37295
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37287

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.



37285
37286
37287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37285

def base_currency
  @base_currency
end

#countryObject (readonly)

Returns the value of attribute country.



37285
37286
37287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37285

def country
  @country
end

#languageObject (readonly)

Returns the value of attribute language.



37285
37286
37287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37285

def language
  @language
end

#localeObject (readonly)

Returns the value of attribute locale.



37285
37286
37287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37285

def locale
  @locale
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



37285
37286
37287
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37285

def timezone
  @timezone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



37301
37302
37303
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37301

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

#to_hashObject



37305
37306
37307
37308
37309
37310
37311
37312
37313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37305

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

#to_jsonObject



37297
37298
37299
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 37297

def to_json
  JSON.dump(to_hash)
end