Class: Io::Flow::V0::Models::ShippingConfigurationCopy

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

Returns a new instance of ShippingConfigurationCopy.



61112
61113
61114
61115
61116
61117
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61112

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:original, :new], 'ShippingConfigurationCopy')
  @original = (x = opts.delete(:original); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationReference) ? x : ::Io::Flow::V0::Models::ShippingConfigurationReference.new(x))
  @new = (x = opts.delete(:new); x.is_a?(::Io::Flow::V0::Models::ShippingConfigurationReference) ? x : ::Io::Flow::V0::Models::ShippingConfigurationReference.new(x))
end

Instance Attribute Details

#newObject (readonly)

Returns the value of attribute new.



61110
61111
61112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61110

def new
  @new
end

#originalObject (readonly)

Returns the value of attribute original.



61110
61111
61112
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61110

def original
  @original
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



61123
61124
61125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61123

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

#to_hashObject



61127
61128
61129
61130
61131
61132
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61127

def to_hash
  {
    :original => original.to_hash,
    :new => new.to_hash
  }
end

#to_jsonObject



61119
61120
61121
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 61119

def to_json
  JSON.dump(to_hash)
end