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.



32531
32532
32533
32534
32535
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32531

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.



32529
32530
32531
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32529

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



32541
32542
32543
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32541

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

#to_hashObject



32545
32546
32547
32548
32549
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32545

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



32537
32538
32539
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 32537

def to_json
  JSON.dump(to_hash)
end