Class: Io::Flow::V0::Models::AtCost

Inherits:
TierRuleOutcome show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Overview

Rule outcome where shipping surfaced in quote is actual cost of the service

Instance Attribute Summary collapse

Attributes inherited from TierRuleOutcome

#discriminator

Instance Method Summary collapse

Methods inherited from TierRuleOutcome

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ AtCost

Returns a new instance of AtCost.



18035
18036
18037
18038
18039
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18035

def initialize(incoming={})
  super(:discriminator => TierRuleOutcome::Types::AT_COST)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  @ignore = (x = opts.delete(:ignore); x.nil? ? nil : HttpClient::Preconditions.assert_class('ignore', x, String))
end

Instance Attribute Details

#ignoreObject (readonly)

Returns the value of attribute ignore.



18033
18034
18035
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18033

def ignore
  @ignore
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



18045
18046
18047
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18045

def copy(incoming={})
  AtCost.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



18049
18050
18051
18052
18053
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18049

def subtype_to_hash
  {
    :ignore => ignore
  }
end

#to_jsonObject



18041
18042
18043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 18041

def to_json
  JSON.dump(to_hash)
end