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.
18950 18951 18952 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18950 def initialize(value) @value = HttpClient::Preconditions.assert_class('value', value, String) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
18948 18949 18950 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18948 def value @value end |
Class Method Details
.ALL ⇒ Object
18970 18971 18972 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18970 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
18955 18956 18957 18958 18959 18960 18961 18962 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18955 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
18980 18981 18982 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18980 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
18965 18966 18967 18968 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18965 def DiscountRuleSubsidyTarget.from_string(value) HttpClient::Preconditions.assert_class('value', value, String) DiscountRuleSubsidyTarget.ALL.find { |v| v.value == value } end |
.vat ⇒ Object
VAT subsidy
18975 18976 18977 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18975 def DiscountRuleSubsidyTarget.vat @@_vat ||= DiscountRuleSubsidyTarget.new('vat') end |
Instance Method Details
#to_hash ⇒ Object
18984 18985 18986 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18984 def to_hash value end |