Class: Io::Flow::V0::Models::PriceFacetBoundary

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

Returns a new instance of PriceFacetBoundary.



18480
18481
18482
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18480

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



18478
18479
18480
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18478

def value
  @value
end

Class Method Details

.ALLObject



18500
18501
18502
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18500

def PriceFacetBoundary.ALL
  @@all ||= [PriceFacetBoundary.min, PriceFacetBoundary.max]
end

.apply(value) ⇒ Object

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



18485
18486
18487
18488
18489
18490
18491
18492
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18485

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

.from_string(value) ⇒ Object

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



18495
18496
18497
18498
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18495

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

.maxObject



18508
18509
18510
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18508

def PriceFacetBoundary.max
  @@_max ||= PriceFacetBoundary.new('max')
end

.minObject



18504
18505
18506
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18504

def PriceFacetBoundary.min
  @@_min ||= PriceFacetBoundary.new('min')
end

Instance Method Details

#to_hashObject



18512
18513
18514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18512

def to_hash
  value
end