Class: Io::Flow::V0::Models::MerchantOfRecord

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ MerchantOfRecord

Returns a new instance of MerchantOfRecord.



22470
22471
22472
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22470

def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



22468
22469
22470
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22468

def value
  @value
end

Class Method Details

.ALLObject



22490
22491
22492
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22490

def MerchantOfRecord.ALL
  @@all ||= [MerchantOfRecord.flow, MerchantOfRecord.organization]
end

.apply(value) ⇒ Object

Returns the instance of MerchantOfRecord for this value, creating a new instance for an unknown value



22475
22476
22477
22478
22479
22480
22481
22482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22475

def MerchantOfRecord.apply(value)
  if value.instance_of?(MerchantOfRecord)
    value
  else
    HttpClient::Preconditions.assert_class_or_nil('value', value, String)
    value.nil? ? nil : (from_string(value) || MerchantOfRecord.new(value))
  end
end

.flowObject



22494
22495
22496
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22494

def MerchantOfRecord.flow
  @@_flow ||= MerchantOfRecord.new('flow')
end

.from_string(value) ⇒ Object

Returns the instance of MerchantOfRecord for this value, or nil if not found



22485
22486
22487
22488
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22485

def MerchantOfRecord.from_string(value)
  HttpClient::Preconditions.assert_class('value', value, String)
  MerchantOfRecord.ALL.find { |v| v.value == value }
end

.organizationObject



22498
22499
22500
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22498

def MerchantOfRecord.organization
  @@_organization ||= MerchantOfRecord.new('organization')
end

Instance Method Details

#to_hashObject



22502
22503
22504
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 22502

def to_hash
  value
end