Class: Io::Flow::V0::Models::ShopifyLocalizationSetting

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 = {}) ⇒ ShopifyLocalizationSetting

Returns a new instance of ShopifyLocalizationSetting.



45630
45631
45632
45633
45634
45635
45636
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45630

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :method, :datetime_range], 'ShopifyLocalizationSetting')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @method = (x = opts.delete(:method); x.is_a?(::Io::Flow::V0::Models::ShopifyLocalizationMethod) ? x : ::Io::Flow::V0::Models::ShopifyLocalizationMethod.apply(x))
  @datetime_range = (x = opts.delete(:datetime_range); x.is_a?(::Io::Flow::V0::Models::DatetimeRange) ? x : ::Io::Flow::V0::Models::DatetimeRange.new(x))
end

Instance Attribute Details

#datetime_rangeObject (readonly)

Returns the value of attribute datetime_range.



45628
45629
45630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45628

def datetime_range
  @datetime_range
end

#idObject (readonly)

Returns the value of attribute id.



45628
45629
45630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45628

def id
  @id
end

#methodObject (readonly)

Returns the value of attribute method.



45628
45629
45630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45628

def method
  @method
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



45642
45643
45644
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45642

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

#to_hashObject



45646
45647
45648
45649
45650
45651
45652
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45646

def to_hash
  {
    :id => id,
    :method => method.value,
    :datetime_range => datetime_range.to_hash
  }
end

#to_jsonObject



45638
45639
45640
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 45638

def to_json
  JSON.dump(to_hash)
end