Class: Io::Flow::V0::Models::SyncStreamReference

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

Returns a new instance of SyncStreamReference.



53467
53468
53469
53470
53471
53472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53467

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



53465
53466
53467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53465

def id
  @id
end

#keyObject (readonly)

Returns the value of attribute key.



53465
53466
53467
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53465

def key
  @key
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53478
53479
53480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53478

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

#to_hashObject



53482
53483
53484
53485
53486
53487
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53482

def to_hash
  {
    :id => id,
    :key => key
  }
end

#to_jsonObject



53474
53475
53476
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53474

def to_json
  JSON.dump(to_hash)
end