module Signable::Concerns::Query::ClassMethods

Public Instance Methods

all(offset = 0, limit = 10) click to toggle source
# File lib/signable/concerns/query.rb, line 37
def all(offset = 0, limit = 10)
  response = client.all(entry_point, offset, limit)

  if response.ok?
    List.new(self, response.object)
  else
    []
  end
end
client() click to toggle source
# File lib/signable/concerns/query.rb, line 61
def client
  @client ||= Signable::Query::Client.new
end
entry_point() click to toggle source
# File lib/signable/concerns/query.rb, line 57
def entry_point
  prefix.pluralize
end
find(id) click to toggle source
# File lib/signable/concerns/query.rb, line 47
def find(id)
  response = client.find(entry_point, id)

  if response.ok?
    self.new response.object
  else
    nil
  end
end