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.



51951
51952
51953
51954
51955
51956
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51951

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.



51949
51950
51951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51949

def order
  @order
end

#statusObject (readonly)

Returns the value of attribute status.



51949
51950
51951
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51949

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



51962
51963
51964
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51962

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

#to_hashObject



51966
51967
51968
51969
51970
51971
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51966

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

#to_jsonObject



51958
51959
51960
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 51958

def to_json
  JSON.dump(to_hash)
end