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.



54912
54913
54914
54915
54916
54917
54918
54919
54920
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54912

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.



54910
54911
54912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54910

def base_currency
  @base_currency
end

#countryObject (readonly)

Returns the value of attribute country.



54910
54911
54912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54910

def country
  @country
end

#languageObject (readonly)

Returns the value of attribute language.



54910
54911
54912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54910

def language
  @language
end

#localeObject (readonly)

Returns the value of attribute locale.



54910
54911
54912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54910

def locale
  @locale
end

#timezoneObject (readonly)

Returns the value of attribute timezone.



54910
54911
54912
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54910

def timezone
  @timezone
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



54926
54927
54928
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54926

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

#to_hashObject



54930
54931
54932
54933
54934
54935
54936
54937
54938
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54930

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

#to_jsonObject



54922
54923
54924
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54922

def to_json
  JSON.dump(to_hash)
end