Class: Io::Flow::V0::Models::CenterReference

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

Returns a new instance of CenterReference.



17042
17043
17044
17045
17046
17047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17042

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:organization_id, :center_key], 'CenterReference')
  @organization_id = HttpClient::Preconditions.assert_class('organization_id', opts.delete(:organization_id), String)
  @center_key = HttpClient::Preconditions.assert_class('center_key', opts.delete(:center_key), String)
end

Instance Attribute Details

#center_keyObject (readonly)

Returns the value of attribute center_key.



17040
17041
17042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17040

def center_key
  @center_key
end

#organization_idObject (readonly)

Returns the value of attribute organization_id.



17040
17041
17042
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17040

def organization_id
  @organization_id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



17053
17054
17055
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17053

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

#to_hashObject



17057
17058
17059
17060
17061
17062
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17057

def to_hash
  {
    :organization_id => organization_id,
    :center_key => center_key
  }
end

#to_jsonObject



17049
17050
17051
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17049

def to_json
  JSON.dump(to_hash)
end