Class: Io::Flow::V0::Models::UserReference

Inherits:
ExpandableUser show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from ExpandableUser

#discriminator

Instance Method Summary collapse

Methods inherited from ExpandableUser

#to_hash

Constructor Details

#initialize(incoming = {}) ⇒ UserReference

Returns a new instance of UserReference.



22600
22601
22602
22603
22604
22605
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22600

def initialize(incoming={})
  super(:discriminator => ExpandableUser::Types::USER_REFERENCE)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'UserReference')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#id ⇒ Object (readonly)

Returns the value of attribute id.



22598
22599
22600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22598

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22611
22612
22613
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22611

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

#subtype_to_hash ⇒ Object



22615
22616
22617
22618
22619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22615

def subtype_to_hash
  {
    :id => id
  }
end

#to_json ⇒ Object



22607
22608
22609
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22607

def to_json
  JSON.dump(to_hash)
end