Class: Io::Flow::V0::Models::Test

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

Returns a new instance of Test.



70356
70357
70358
70359
70360
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70356

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



70354
70355
70356
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70354

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



70366
70367
70368
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70366

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

#to_hashObject



70370
70371
70372
70373
70374
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70370

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



70362
70363
70364
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 70362

def to_json
  JSON.dump(to_hash)
end