Class: Io::Flow::V0::Models::ChannelReference

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

Returns a new instance of ChannelReference.



30848
30849
30850
30851
30852
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30848

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



30846
30847
30848
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30846

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



30858
30859
30860
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30858

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

#to_hashObject



30862
30863
30864
30865
30866
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30862

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



30854
30855
30856
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 30854

def to_json
  JSON.dump(to_hash)
end