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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ OrderFraudStatus

Returns a new instance of OrderFraudStatus.



29767
29768
29769
29770
29771
29772
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29767

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.



29765
29766
29767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29765

def order
  @order
end

#statusObject (readonly)

Returns the value of attribute status.



29765
29766
29767
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29765

def status
  @status
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



29778
29779
29780
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29778

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

#to_hashObject



29782
29783
29784
29785
29786
29787
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29782

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

#to_jsonObject



29774
29775
29776
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 29774

def to_json
  JSON.dump(to_hash)
end