class Cryptopay::ExchangeTransfer

Constants

ENCODER

Public Class Methods

build_from_hash(data) click to toggle source

Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Cryptopay::ExchangeTransfer] Returns the model itself

# File lib/cryptopay/models/exchange_transfer.rb, line 101
def self.build_from_hash(data)
  attributes = ENCODER.build_from_hash(data)
  new(attributes)
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/cryptopay/models/exchange_transfer.rb, line 36
def initialize(attributes = {})
  @attributes = ENCODER.sanitize(attributes)
end

Public Instance Methods

charged_amount() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 44
def charged_amount
  @attributes[:charged_amount]
end
charged_currency() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 48
def charged_currency
  @attributes[:charged_currency]
end
custom_id() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 60
def custom_id
  @attributes[:custom_id]
end
exchange() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 64
def exchange
  @attributes[:exchange]
end
id() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 40
def id
  @attributes[:id]
end
inspect() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 112
def inspect
  "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash)
end
invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properties with the reasons

# File lib/cryptopay/models/exchange_transfer.rb, line 70
def invalid_properties
  properties = []

  properties.push('invalid value for "id", id cannot be nil.') if id.nil?

  properties.push('invalid value for "charged_amount", charged_amount cannot be nil.') if charged_amount.nil?

  properties.push('invalid value for "charged_currency", charged_currency cannot be nil.') if charged_currency.nil?

  properties.push('invalid value for "received_amount", received_amount cannot be nil.') if received_amount.nil?

  if received_currency.nil?
    properties.push('invalid value for "received_currency", received_currency cannot be nil.')
  end

  exchange&.invalid_properties&.each do |prop|
    properties.push("invalid value for \"exchange\": #{prop}")
  end

  properties
end
received_amount() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 52
def received_amount
  @attributes[:received_amount]
end
received_currency() click to toggle source
# File lib/cryptopay/models/exchange_transfer.rb, line 56
def received_currency
  @attributes[:received_currency]
end
to_hash() click to toggle source

Returns the object in the form of hash @return [Hash] Returns the object in the form of hash

# File lib/cryptopay/models/exchange_transfer.rb, line 108
def to_hash
  ENCODER.to_hash(@attributes)
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/cryptopay/models/exchange_transfer.rb, line 94
def valid?
  invalid_properties.empty?
end