lib/mashery/rpc_client/base.rb in mashery_rails-0.6.2 vs lib/mashery/rpc_client/base.rb in mashery_rails-0.6.3

- old
+ new

@@ -13,10 +13,14 @@ def self.all default_query.all end + def self.select(argument) + default_query.select(argument) + end + def self.items(argument) default_query.items(argument) end def self.where(argument) @@ -29,19 +33,21 @@ def self.find_each(&block) default_query.find_each(&block) end + def self.first + new(standard_query.items(1).all.items[0]) + end + + protected + def self.standard_query Mashery.rpc.query_builder(self).from(object_type).items(100) end def self.default_query standard_query - end - - def self.first - new(standard_query.items(1).all.items[0]) end def self.object_type self.name.underscore.split('/').last.pluralize end