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.



12615
12616
12617
12618
12619
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12615

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.



12613
12614
12615
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12613

def ignore
  @ignore
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



12625
12626
12627
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12625

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

#subtype_to_hashObject



12629
12630
12631
12632
12633
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12629

def subtype_to_hash
  {
    :ignore => ignore
  }
end

#to_jsonObject



12621
12622
12623
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 12621

def to_json
  JSON.dump(to_hash)
end