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.



23377
23378
23379
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23377

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



23375
23376
23377
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23375

def value
  @value
end

Class Method Details

.ALLObject



23397
23398
23399
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23397

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



23382
23383
23384
23385
23386
23387
23388
23389
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23382

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



23392
23393
23394
23395
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23392

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

.maxObject



23405
23406
23407
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23405

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

.minObject



23401
23402
23403
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23401

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

Instance Method Details

#to_hashObject



23409
23410
23411
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 23409

def to_hash
  value
end