Class: Io::Flow::V0::Models::SyncRecordForm

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

Returns a new instance of SyncRecordForm.



54149
54150
54151
54152
54153
54154
54155
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54149

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

Instance Attribute Details

#stream_keyObject (readonly)

Returns the value of attribute stream_key.



54147
54148
54149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54147

def stream_key
  @stream_key
end

#systemObject (readonly)

Returns the value of attribute system.



54147
54148
54149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54147

def system
  @system
end

#valueObject (readonly)

Returns the value of attribute value.



54147
54148
54149
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54147

def value
  @value
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



54161
54162
54163
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54161

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

#to_hashObject



54165
54166
54167
54168
54169
54170
54171
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54165

def to_hash
  {
    :stream_key => stream_key,
    :system => system,
    :value => value
  }
end

#to_jsonObject



54157
54158
54159
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54157

def to_json
  JSON.dump(to_hash)
end