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.



19111
19112
19113
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19111

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



19109
19110
19111
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19109

def value
  @value
end

Class Method Details

.ALLObject



19131
19132
19133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19131

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



19116
19117
19118
19119
19120
19121
19122
19123
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19116

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



19126
19127
19128
19129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19126

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

.maxObject



19139
19140
19141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19139

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

.minObject



19135
19136
19137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19135

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

Instance Method Details

#to_hashObject



19143
19144
19145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 19143

def to_hash
  value
end