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.



9107
9108
9109
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9107

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

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



9105
9106
9107
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9105

def value
  @value
end

Class Method Details

.ALLObject



9127
9128
9129
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9127

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



9112
9113
9114
9115
9116
9117
9118
9119
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9112

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



9135
9136
9137
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9135

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



9122
9123
9124
9125
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9122

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

.ignoredObject



9139
9140
9141
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9139

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

.includedObject



9131
9132
9133
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9131

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

Instance Method Details

#to_hashObject



9143
9144
9145
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9143

def to_hash
  value
end