class Malartu::MalartuObject
Attributes
json[RW]
Public Class Methods
new(json)
click to toggle source
# File lib/malartu/malartu_object.rb, line 4 def initialize(json) json.each do |k, v| define_singleton_method(k) { v } end @json = json end
paginate?(response)
click to toggle source
# File lib/malartu/malartu_object.rb, line 11 def self.paginate?(response) page = response['page'].to_i limit = response['limit'].to_i found = response['found'].to_i count = response['count'].to_i ((page - 1) * limit) + count < found end