Class: Io::Flow::V0::Models::TaxReportType

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

Returns a new instance of TaxReportType.



27311
27312
27313
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27311

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



27309
27310
27311
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27309

def value
  @value
end

Class Method Details

.ALLObject



27331
27332
27333
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27331

def TaxReportType.ALL
  @@all ||= [TaxReportType.consumer, TaxReportType.b2b]
end

.apply(value) ⇒ Object

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



27316
27317
27318
27319
27320
27321
27322
27323
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27316

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

.b2bObject



27339
27340
27341
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27339

def TaxReportType.b2b
  @@_b2b ||= TaxReportType.new('b2b')
end

.consumerObject



27335
27336
27337
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27335

def TaxReportType.consumer
  @@_consumer ||= TaxReportType.new('consumer')
end

.from_string(value) ⇒ Object

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



27326
27327
27328
27329
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27326

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

Instance Method Details

#to_hashObject



27343
27344
27345
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27343

def to_hash
  value
end