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

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ UserReference

Returns a new instance of UserReference.



51758
51759
51760
51761
51762
51763
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51758

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

#idObject (readonly)

Returns the value of attribute id.



51756
51757
51758
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51756

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51769
51770
51771
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51769

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

#subtype_to_hashObject



51773
51774
51775
51776
51777
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51773

def subtype_to_hash
  {
    :id => id
  }
end

#to_jsonObject



51765
51766
51767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51765

def to_json
  JSON.dump(to_hash)
end