Class: Io::Flow::V0::Models::OrderFraudStatus

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

Overview

The fraud status for an order.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderFraudStatus

Returns a new instance of OrderFraudStatus.



39499
39500
39501
39502
39503
39504
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39499

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:order, :status], 'OrderFraudStatus')
  @order = (x = opts.delete(:order); x.is_a?(::Io::Flow::V0::Models::OrderReference) ? x : ::Io::Flow::V0::Models::OrderReference.new(x))
  @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::FraudStatus) ? x : ::Io::Flow::V0::Models::FraudStatus.apply(x))
end

Instance Attribute Details

#orderObject (readonly)

Returns the value of attribute order.



39497
39498
39499
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39497

def order
  @order
end

#statusObject (readonly)

Returns the value of attribute status.



39497
39498
39499
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39497

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



39510
39511
39512
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39510

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

#to_hashObject



39514
39515
39516
39517
39518
39519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39514

def to_hash
  {
    :order => order.to_hash,
    :status => status.value
  }
end

#to_jsonObject



39506
39507
39508
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 39506

def to_json
  JSON.dump(to_hash)
end