Class: Io::Flow::V0::Models::TaxApplicability

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

Returns a new instance of TaxApplicability.



16439
16440
16441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16439

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



16437
16438
16439
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16437

def value
  @value
end

Class Method Details

.allObject

In all scenarios a customer should pay tax within the Flow system.



16469
16470
16471
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16469

def TaxApplicability.all
  @@_all ||= TaxApplicability.new('all')
end

.ALLObject



16459
16460
16461
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16459

def TaxApplicability.ALL
  @@all ||= [TaxApplicability.none, TaxApplicability.all]
end

.apply(value) ⇒ Object

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



16444
16445
16446
16447
16448
16449
16450
16451
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16444

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

.from_string(value) ⇒ Object

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



16454
16455
16456
16457
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16454

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

.noneObject

In no scenario should a customer pay tax within the Flow system.



16464
16465
16466
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16464

def TaxApplicability.none
  @@_none ||= TaxApplicability.new('none')
end

Instance Method Details

#to_hashObject



16473
16474
16475
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16473

def to_hash
  value
end