Class: Io::Flow::V0::Models::B2bInvoiceType

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) ⇒ B2bInvoiceType

Returns a new instance of B2bInvoiceType.



13588
13589
13590
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13588

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



13586
13587
13588
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13586

def value
  @value
end

Class Method Details

.ALLObject



13608
13609
13610
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13608

def B2bInvoiceType.ALL
  @@all ||= [B2bInvoiceType.self_bill_invoice, B2bInvoiceType.invoice]
end

.apply(value) ⇒ Object

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



13593
13594
13595
13596
13597
13598
13599
13600
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13593

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

.from_string(value) ⇒ Object

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



13603
13604
13605
13606
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13603

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

.invoiceObject



13616
13617
13618
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13616

def B2bInvoiceType.invoice
  @@_invoice ||= B2bInvoiceType.new('invoice')
end

.self_bill_invoiceObject



13612
13613
13614
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13612

def B2bInvoiceType.self_bill_invoice
  @@_self_bill_invoice ||= B2bInvoiceType.new('self_bill_invoice')
end

Instance Method Details

#to_hashObject



13620
13621
13622
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 13620

def to_hash
  value
end