Class: Io::Flow::V0::Models::TokenReference

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

Defined Under Namespace

Modules: Types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ TokenReference

Returns a new instance of TokenReference.



5533
5534
5535
5536
5537
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5533

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

Instance Attribute Details

#discriminator ⇒ Object (readonly)

Returns the value of attribute discriminator.



5531
5532
5533
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5531

def discriminator
  @discriminator
end

Instance Method Details

#subtype_to_hash ⇒ Object



5539
5540
5541
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5539

def subtype_to_hash
  raise 'Cannot serialize an instance of token_reference directly - must use one of the specific types: organization_token_reference, partner_token_reference'
end

#to_hash ⇒ Object



5543
5544
5545
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 5543

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