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



19345
19346
19347
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19345

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19343
19344
19345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19343

def value
  @value
end

Class Method Details

.allObject

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



19375
19376
19377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19375

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

.ALLObject



19365
19366
19367
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19365

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



19350
19351
19352
19353
19354
19355
19356
19357
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19350

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



19360
19361
19362
19363
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19360

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.



19370
19371
19372
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19370

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

Instance Method Details

#to_hashObject



19379
19380
19381
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19379

def to_hash
  value
end