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.



48774
48775
48776
48777
48778
48779
48780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48774

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.



48772
48773
48774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48772

def datetime_range
  @datetime_range
end

#idObject (readonly)

Returns the value of attribute id.



48772
48773
48774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48772

def id
  @id
end

#methodObject (readonly)

Returns the value of attribute method.



48772
48773
48774
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48772

def method
  @method
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



48786
48787
48788
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48786

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

#to_hashObject



48790
48791
48792
48793
48794
48795
48796
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48790

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

#to_jsonObject



48782
48783
48784
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 48782

def to_json
  JSON.dump(to_hash)
end