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

Instance Method Summary collapse

Methods inherited from TierRuleOutcome

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ AtCost

Returns a new instance of AtCost.



8040
8041
8042
8043
8044
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8040

def initialize(incoming={})
  super(:name => 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.



8038
8039
8040
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8038

def ignore
  @ignore
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



8050
8051
8052
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8050

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

#subtype_to_hashObject



8054
8055
8056
8057
8058
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8054

def subtype_to_hash
  {
    :ignore => ignore
  }
end

#to_jsonObject



8046
8047
8048
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 8046

def to_json
  JSON.dump(to_hash)
end