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.
16857 16858 16859 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16857 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
16855 16856 16857 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16855 def value @value end |
Class Method Details
.ALL ⇒ Object
16877 16878 16879 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16877 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
16862 16863 16864 16865 16866 16867 16868 16869 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16862 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
16887 16888 16889 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16887 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
16872 16873 16874 16875 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16872 def DiscountRuleSubsidyTarget.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleSubsidyTarget.ALL.find { |v| v.value == value } end |
.vat ⇒ Object
VAT subsidy
16882 16883 16884 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16882 def DiscountRuleSubsidyTarget.vat @@_vat ||= DiscountRuleSubsidyTarget.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
16891 16892 16893 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 16891 def to_hash value end |