Class: Io::Flow::V0::Models::PricingLevySetting

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

Returns a new instance of PricingLevySetting.



8630
8631
8632
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8630

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



8628
8629
8630
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8628

def value
  @value
end

Class Method Details

.ALLObject



8650
8651
8652
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8650

def PricingLevySetting.ALL
  @@all ||= [PricingLevySetting.included, PricingLevySetting.displayed, PricingLevySetting.ignored]
end

.apply(value) ⇒ Object

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



8635
8636
8637
8638
8639
8640
8641
8642
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8635

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

.displayedObject



8658
8659
8660
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8658

def PricingLevySetting.displayed
  @@_displayed ||= PricingLevySetting.new('displayed')
end

.from_string(value) ⇒ Object

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



8645
8646
8647
8648
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8645

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

.ignoredObject



8662
8663
8664
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8662

def PricingLevySetting.ignored
  @@_ignored ||= PricingLevySetting.new('ignored')
end

.includedObject



8654
8655
8656
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8654

def PricingLevySetting.included
  @@_included ||= PricingLevySetting.new('included')
end

Instance Method Details

#to_hashObject



8666
8667
8668
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8666

def to_hash
  value
end