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.



17026
17027
17028
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17026

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



17024
17025
17026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17024

def value
  @value
end

Class Method Details

.ALLObject



17046
17047
17048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17046

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



17031
17032
17033
17034
17035
17036
17037
17038
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17031

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



17050
17051
17052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17050

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



17041
17042
17043
17044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17041

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

.organizationObject



17054
17055
17056
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17054

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

Instance Method Details

#to_hashObject



17058
17059
17060
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17058

def to_hash
  value
end