Class: Io::Flow::V0::Models::SyncPendingRecord

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

Returns a new instance of SyncPendingRecord.



51738
51739
51740
51741
51742
51743
51744
51745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51738

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :stream, :value, :system], 'SyncPendingRecord')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @stream = (x = opts.delete(:stream); x.is_a?(::Io::Flow::V0::Models::SyncStreamReference) ? x : ::Io::Flow::V0::Models::SyncStreamReference.new(x))
  @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String)
  @system = HttpClient::Preconditions.assert_class('system', opts.delete(:system), String)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



51736
51737
51738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51736

def id
  @id
end

#streamObject (readonly)

Returns the value of attribute stream.



51736
51737
51738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51736

def stream
  @stream
end

#systemObject (readonly)

Returns the value of attribute system.



51736
51737
51738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51736

def system
  @system
end

#valueObject (readonly)

Returns the value of attribute value.



51736
51737
51738
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51736

def value
  @value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51751
51752
51753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51751

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

#to_hashObject



51755
51756
51757
51758
51759
51760
51761
51762
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51755

def to_hash
  {
    :id => id,
    :stream => stream.to_hash,
    :value => value,
    :system => system
  }
end

#to_jsonObject



51747
51748
51749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51747

def to_json
  JSON.dump(to_hash)
end