Class: Io::Flow::V0::Models::ShopifyLocalizationSettingForm

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

Returns a new instance of ShopifyLocalizationSettingForm.



67641
67642
67643
67644
67645
67646
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67641

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:method, :datetime_range], 'ShopifyLocalizationSettingForm')
  @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.



67639
67640
67641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67639

def datetime_range
  @datetime_range
end

#methodObject (readonly)

Returns the value of attribute method.



67639
67640
67641
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67639

def method
  @method
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



67652
67653
67654
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67652

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

#to_hashObject



67656
67657
67658
67659
67660
67661
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67656

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

#to_jsonObject



67648
67649
67650
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 67648

def to_json
  JSON.dump(to_hash)
end