Class: Io::Flow::V0::Models::ZeroAmountIndicator

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

Returns a new instance of ZeroAmountIndicator.



26409
26410
26411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26409

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



26407
26408
26409
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26407

def value
  @value
end

Class Method Details

.ALLObject



26429
26430
26431
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26429

def ZeroAmountIndicator.ALL
  @@all ||= [ZeroAmountIndicator.zero, ZeroAmountIndicator.free]
end

.apply(value) ⇒ Object

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



26414
26415
26416
26417
26418
26419
26420
26421
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26414

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

.freeObject

Show the word ‘FREE` in the label



26439
26440
26441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26439

def ZeroAmountIndicator.free
  @@_free ||= ZeroAmountIndicator.new('free')
end

.from_string(value) ⇒ Object

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



26424
26425
26426
26427
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26424

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

.zeroObject

Show the number 0.00 in the label



26434
26435
26436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26434

def ZeroAmountIndicator.zero
  @@_zero ||= ZeroAmountIndicator.new('zero')
end

Instance Method Details

#to_hashObject



26443
26444
26445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 26443

def to_hash
  value
end