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



25226
25227
25228
25229
25230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25226

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.



25224
25225
25226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25224

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



25236
25237
25238
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25236

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

#to_hashObject



25240
25241
25242
25243
25244
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25240

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



25232
25233
25234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 25232

def to_json
  JSON.dump(to_hash)
end