class Cryptopay::ChannelParams
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::ChannelParams] Returns the model itself
# File lib/cryptopay/models/channel_params.rb, line 87 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/channel_params.rb, line 32 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end
Public Instance Methods
custom_id()
click to toggle source
The payment reference ID in your system
# File lib/cryptopay/models/channel_params.rb, line 53 def custom_id @attributes[:custom_id] end
customer_id()
click to toggle source
The internal ID of your customer that the channel relates to
# File lib/cryptopay/models/channel_params.rb, line 58 def customer_id @attributes[:customer_id] end
description()
click to toggle source
# File lib/cryptopay/models/channel_params.rb, line 40 def description @attributes[:description] end
inspect()
click to toggle source
# File lib/cryptopay/models/channel_params.rb, line 98 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/channel_params.rb, line 64 def invalid_properties properties = [] properties.push('invalid value for "name", name cannot be nil.') if name.nil? properties.push('invalid value for "pay_currency", pay_currency cannot be nil.') if pay_currency.nil? if receiver_currency.nil? properties.push('invalid value for "receiver_currency", receiver_currency cannot be nil.') end properties end
name()
click to toggle source
# File lib/cryptopay/models/channel_params.rb, line 36 def name @attributes[:name] end
pay_currency()
click to toggle source
# File lib/cryptopay/models/channel_params.rb, line 44 def pay_currency @attributes[:pay_currency] end
receiver_currency()
click to toggle source
# File lib/cryptopay/models/channel_params.rb, line 48 def receiver_currency @attributes[:receiver_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/channel_params.rb, line 94 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/channel_params.rb, line 80 def valid? invalid_properties.empty? end