Class: Io::Flow::V0::Models::ShopifyOrderAttributesForm

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

Returns a new instance of ShopifyOrderAttributesForm.



40119
40120
40121
40122
40123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40119

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:attributes], 'ShopifyOrderAttributesForm')
  @attributes = HttpClient::Preconditions.assert_class('attributes', opts.delete(:attributes), Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h }
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



40117
40118
40119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40117

def attributes
  @attributes
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40129
40130
40131
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40129

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

#to_hashObject



40133
40134
40135
40136
40137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40133

def to_hash
  {
    :attributes => attributes
  }
end

#to_jsonObject



40125
40126
40127
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40125

def to_json
  JSON.dump(to_hash)
end