Class: Io::Flow::V0::Models::ExpandableItemFunction

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

Overview

An item function can be represented with just its Id, or the entire model

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ExpandableItemFunction

Returns a new instance of ExpandableItemFunction.



4620
4621
4622
4623
4624
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4620

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

Instance Attribute Details

#discriminator ⇒ Object (readonly)

Returns the value of attribute discriminator.



4618
4619
4620
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4618

def discriminator
  @discriminator
end

Instance Method Details

#subtype_to_hash ⇒ Object



4626
4627
4628
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4626

def subtype_to_hash
  raise 'Cannot serialize an instance of expandable_item_function directly - must use one of the specific types: item_function, item_function_reference'
end

#to_hash ⇒ Object



4630
4631
4632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 4630

def to_hash
  subtype_to_hash.merge(:discriminator => @discriminator)
end