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.
17580 17581 17582 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17580 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
17578 17579 17580 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17578 def value @value end |
Class Method Details
.ALL ⇒ Object
17600 17601 17602 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17600 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
17585 17586 17587 17588 17589 17590 17591 17592 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17585 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
17610 17611 17612 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17610 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
17595 17596 17597 17598 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17595 def DiscountRuleSubsidyTarget.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleSubsidyTarget.ALL.find { |v| v.value == value } end |
.vat ⇒ Object
VAT subsidy
17605 17606 17607 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17605 def DiscountRuleSubsidyTarget.vat @@_vat ||= DiscountRuleSubsidyTarget.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
17614 17615 17616 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 17614 def to_hash value end |