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

#to_hash

Constructor Details

#initialize(incoming = {}) ⇒ AtCost

Returns a new instance of AtCost.



9507
9508
9509
9510
9511
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9507

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

#ignore ⇒ Object (readonly)

Returns the value of attribute ignore.



9505
9506
9507
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9505

def ignore
  @ignore
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



9517
9518
9519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9517

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

#subtype_to_hash ⇒ Object



9521
9522
9523
9524
9525
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9521

def subtype_to_hash
  {
    :ignore => ignore
  }
end

#to_json ⇒ Object



9513
9514
9515
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 9513

def to_json
  JSON.dump(to_hash)
end