class Io::Flow::V0::Models::DiscountRuleSubsidyTarget

Attributes

value[R]

Public Class Methods

ALL() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18970
def DiscountRuleSubsidyTarget.ALL
  @@all ||= [DiscountRuleSubsidyTarget.vat, DiscountRuleSubsidyTarget.duty]
end
apply(value) click to toggle source

Returns the instance of DiscountRuleSubsidyTarget for this value, creating a new instance for an unknown value

# 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() click to toggle source

Duty subsidy

# File lib/flow_commerce/flow_api_v0_client.rb, line 18980
def DiscountRuleSubsidyTarget.duty
  @@_duty ||= DiscountRuleSubsidyTarget.new('duty')
end
from_string(value) click to toggle source

Returns the instance of DiscountRuleSubsidyTarget for this value, or nil if not found

# 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
new(value) click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18950
def initialize(value)
  @value = HttpClient::Preconditions.assert_class('value', value, String)
end
vat() click to toggle source

VAT subsidy

# File lib/flow_commerce/flow_api_v0_client.rb, line 18975
def DiscountRuleSubsidyTarget.vat
  @@_vat ||= DiscountRuleSubsidyTarget.new('vat')
end

Public Instance Methods

to_hash() click to toggle source
# File lib/flow_commerce/flow_api_v0_client.rb, line 18984
def to_hash
  value
end