Class: Io::Flow::V0::Models::ServiceReference

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

Returns a new instance of ServiceReference.



47439
47440
47441
47442
47443
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47439

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



47437
47438
47439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47437

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47449
47450
47451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47449

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

#to_hashObject



47453
47454
47455
47456
47457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47453

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



47445
47446
47447
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47445

def to_json
  JSON.dump(to_hash)
end