Class: Cryptopay::Pagination
- Inherits:
-
Object
- Object
- Cryptopay::Pagination
- Defined in:
- lib/cryptopay/models/pagination.rb
Class Method Summary collapse
-
.build_from_hash(data) ⇒ Cryptopay::Pagination
Builds the object from hash.
Instance Method Summary collapse
- #has_more ⇒ Object
-
#initialize(attributes = {}) ⇒ Pagination
constructor
Initializes the object.
- #inspect ⇒ Object
-
#invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
- #total ⇒ Object
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Pagination
Initializes the object
32 33 34 |
# File 'lib/cryptopay/models/pagination.rb', line 32 def initialize(attributes = {}) @attributes = ENCODER.sanitize(attributes) end |
Class Method Details
.build_from_hash(data) ⇒ Cryptopay::Pagination
Builds the object from hash
25 26 27 28 |
# File 'lib/cryptopay/models/pagination.rb', line 25 def self.build_from_hash(data) attributes = ENCODER.build_from_hash(data) new(attributes) end |
Instance Method Details
#has_more ⇒ Object
40 41 42 |
# File 'lib/cryptopay/models/pagination.rb', line 40 def has_more @attributes[:has_more] end |
#inspect ⇒ Object
68 69 70 |
# File 'lib/cryptopay/models/pagination.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/pagination.rb', line 46 def invalid_properties properties = [] properties.push('invalid value for "total", total cannot be nil.') if total.nil? properties.push('invalid value for "has_more", has_more cannot be nil.') if has_more.nil? properties end |
#to_hash ⇒ Hash
Returns the object in the form of hash
64 65 66 |
# File 'lib/cryptopay/models/pagination.rb', line 64 def to_hash ENCODER.to_hash(@attributes) end |
#total ⇒ Object
36 37 38 |
# File 'lib/cryptopay/models/pagination.rb', line 36 def total @attributes[:total] end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
58 59 60 |
# File 'lib/cryptopay/models/pagination.rb', line 58 def valid? invalid_properties.empty? end |