class Masheri::RpcClient::Base
Public Class Methods
all()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 14 def self.all default_query.all end
count()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 10 def self.count default_query.items(1).to_json["result"]["total_items"] end
default_query()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 38 def self.default_query standard_query end
find_each(&block)
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 30 def self.find_each(&block) default_query.find_each(&block) end
first()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 42 def self.first new(standard_query.items(1).all.items[0]) end
items(argument)
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 18 def self.items(argument) default_query.items(argument) end
new(attributes)
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 4 def initialize(attributes) attributes.each do |key, value| send("#{key}=", value) end end
object_type()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 46 def self.object_type self.name.underscore.split('/').last.pluralize end
page(argument)
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 26 def self.page(argument) default_query.page(argument) end
standard_query()
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 34 def self.standard_query Masheri.rpc.query_builder(self).from(object_type).items(100) end
where(argument)
click to toggle source
# File lib/masheri/rpc_client/base.rb, line 22 def self.where(argument) default_query.where(argument) end