Class: Io::Flow::V0::Models::DiscountRuleSubsidyTarget
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::DiscountRuleSubsidyTarget
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Class Method Summary collapse
- .ALL ⇒ Object
-
.apply(value) ⇒ Object
Returns the instance of DiscountRuleSubsidyTarget for this value, creating a new instance for an unknown value.
-
.duty ⇒ Object
Duty subsidy.
-
.from_string(value) ⇒ Object
Returns the instance of DiscountRuleSubsidyTarget for this value, or nil if not found.
-
.vat ⇒ Object
VAT subsidy.
Instance Method Summary collapse
-
#initialize(value) ⇒ DiscountRuleSubsidyTarget
constructor
A new instance of DiscountRuleSubsidyTarget.
- #to_hash ⇒ Object
Constructor Details
#initialize(value) ⇒ DiscountRuleSubsidyTarget
Returns a new instance of DiscountRuleSubsidyTarget.
14822 14823 14824 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14822 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
14820 14821 14822 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14820 def value @value end |
Class Method Details
.ALL ⇒ Object
14842 14843 14844 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14842 def DiscountRuleSubsidyTarget.ALL @@all ||= [DiscountRuleSubsidyTarget.vat, DiscountRuleSubsidyTarget.duty] end |
.apply(value) ⇒ Object
Returns the instance of DiscountRuleSubsidyTarget for this value, creating a new instance for an unknown value
14827 14828 14829 14830 14831 14832 14833 14834 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14827 def DiscountRuleSubsidyTarget.apply(value) if value.instance_of?(DiscountRuleSubsidyTarget) value else HttpClient::Preconditions.assert_class_or_nil('value', value, String) value.nil? ? nil : (from_string(value) || DiscountRuleSubsidyTarget.new(value)) end end |
.duty ⇒ Object
Duty subsidy
14852 14853 14854 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14852 def DiscountRuleSubsidyTarget.duty @@_duty ||= DiscountRuleSubsidyTarget.new('duty') end |
.from_string(value) ⇒ Object
Returns the instance of DiscountRuleSubsidyTarget for this value, or nil if not found
14837 14838 14839 14840 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14837 def DiscountRuleSubsidyTarget.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleSubsidyTarget.ALL.find { |v| v.value == value } end |
.vat ⇒ Object
VAT subsidy
14847 14848 14849 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14847 def DiscountRuleSubsidyTarget.vat @@_vat ||= DiscountRuleSubsidyTarget.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
14856 14857 14858 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 14856 def to_hash value end |