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.



42834
42835
42836
42837
42838
42839
42840
42841
42842
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42834

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.



42832
42833
42834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42832

def base_currency
  @base_currency
end

#countryObject (readonly)

Returns the value of attribute country.



42832
42833
42834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42832

def country
  @country
end

#languageObject (readonly)

Returns the value of attribute language.



42832
42833
42834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42832

def language
  @language
end

#localeObject (readonly)

Returns the value of attribute locale.



42832
42833
42834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42832

def locale
  @locale
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



42832
42833
42834
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42832

def timezone
  @timezone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42848
42849
42850
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42848

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

#to_hashObject



42852
42853
42854
42855
42856
42857
42858
42859
42860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42852

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

#to_jsonObject



42844
42845
42846
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42844

def to_json
  JSON.dump(to_hash)
end