Class: Io::Flow::V0::Models::ItemFunctionReference

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

Instance Attribute Summary collapse

Attributes inherited from ExpandableItemFunction

#discriminator

Instance Method Summary collapse

Methods inherited from ExpandableItemFunction

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ ItemFunctionReference

Returns a new instance of ItemFunctionReference.



22698
22699
22700
22701
22702
22703
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22698

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



22696
22697
22698
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22696

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



22709
22710
22711
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22709

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

#subtype_to_hashObject



22713
22714
22715
22716
22717
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22713

def subtype_to_hash
  {
    :id => id
  }
end

#to_jsonObject



22705
22706
22707
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22705

def to_json
  JSON.dump(to_hash)
end