Class: Cryptopay::CoinDestinationTag
- Inherits:
-
Object
- Object
- Cryptopay::CoinDestinationTag
- Defined in:
- lib/cryptopay/models/coin_destination_tag.rb
Class Method Summary collapse
-
.build_from_hash(data) ⇒ Cryptopay::CoinDestinationTag
Builds the object from hash.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ CoinDestinationTag
constructor
Initializes the object.
- #inspect ⇒ Object
-
#invalid_properties ⇒ Object
Show invalid properties with the reasons.
- #name ⇒ Object
- #required ⇒ Object
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ CoinDestinationTag
Initializes the object
32 33 34 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 32 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end |
Class Method Details
.build_from_hash(data) ⇒ Cryptopay::CoinDestinationTag
Builds the object from hash
25 26 27 28 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 25 def self.build_from_hash(data) attributes = ENCODER.build_from_hash(data) new(attributes) end |
Instance Method Details
#inspect ⇒ Object
68 69 70 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 68 def inspect "#<#{self.class}:0x#{object_id.to_s(16)}> JSON: " + JSON.pretty_generate(to_hash) end |
#invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
46 47 48 49 50 51 52 53 54 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 46 def invalid_properties properties = [] properties.push('invalid value for "required", required cannot be nil.') if required.nil? properties.push('invalid value for "name", name cannot be nil.') if name.nil? properties end |
#name ⇒ Object
40 41 42 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 40 def name @attributes[:name] end |
#required ⇒ Object
36 37 38 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 36 def required @attributes[:required] end |
#to_hash ⇒ Hash
Returns the object in the form of hash
64 65 66 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 64 def to_hash ENCODER.to_hash(@attributes) end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
58 59 60 |
# File 'lib/cryptopay/models/coin_destination_tag.rb', line 58 def valid? invalid_properties.empty? end |