Class: Io::Flow::V0::Models::PayoutStatus

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 = {}) ⇒ PayoutStatus

Returns a new instance of PayoutStatus.



54740
54741
54742
54743
54744
54745
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54740

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:code], 'PayoutStatus')
  @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::PayoutStatusCode) ? x : ::Io::Flow::V0::Models::PayoutStatusCode.apply(x))
  @reason = (x = opts.delete(:reason); x.nil? ? nil : HttpClient::Preconditions.assert_class('reason', x, String))
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



54738
54739
54740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54738

def code
  @code
end

#reasonObject (readonly)

Returns the value of attribute reason.



54738
54739
54740
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54738

def reason
  @reason
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



54751
54752
54753
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54751

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

#to_hashObject



54755
54756
54757
54758
54759
54760
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54755

def to_hash
  {
    :code => code.value,
    :reason => reason
  }
end

#to_jsonObject



54747
54748
54749
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 54747

def to_json
  JSON.dump(to_hash)
end