Class: Io::Flow::V0::Models::SyncRecord
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::SyncRecord
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#stream ⇒ Object
readonly
Returns the value of attribute stream.
-
#system ⇒ Object
readonly
Returns the value of attribute system.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SyncRecord
constructor
A new instance of SyncRecord.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ SyncRecord
Returns a new instance of SyncRecord.
52542 52543 52544 52545 52546 52547 52548 52549 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52542 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:id, :system, :value, :stream], 'SyncRecord') @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String) @system = HttpClient::Preconditions.assert_class('system', opts.delete(:system), String) @value = HttpClient::Preconditions.assert_class('value', opts.delete(:value), String) @stream = (x = opts.delete(:stream); x.is_a?(::Io::Flow::V0::Models::SyncStreamReference) ? x : ::Io::Flow::V0::Models::SyncStreamReference.new(x)) end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
52540 52541 52542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52540 def id @id end |
#stream ⇒ Object (readonly)
Returns the value of attribute stream.
52540 52541 52542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52540 def stream @stream end |
#system ⇒ Object (readonly)
Returns the value of attribute system.
52540 52541 52542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52540 def system @system end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
52540 52541 52542 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52540 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
52555 52556 52557 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52555 def copy(incoming={}) SyncRecord.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
52559 52560 52561 52562 52563 52564 52565 52566 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52559 def to_hash { :id => id, :system => system, :value => value, :stream => stream.to_hash } end |
#to_json ⇒ Object
52551 52552 52553 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 52551 def to_json JSON.dump(to_hash) end |