lib/loquor/resource.rb in loquor-1.6.0 vs lib/loquor/resource.rb in loquor-1.7.0
- old
+ new
@@ -34,19 +34,13 @@
def self.find(id)
ApiCall::Show.new(self, id).execute
end
- def self.find_each(&block)
- ApiCall::Index.new(self).find_each(&block)
- end
-
- def self.select(*args)
- ApiCall::Index.new(self).select(*args)
- end
-
- def self.where(*args)
- ApiCall::Index.new(self).where(*args)
+ %w{where per page order select find_each}.each do |meth|
+ self.class.send :define_method, meth do |*args, &block|
+ ApiCall::Index.new(self).send(meth, *args, &block)
+ end
end
def self.create(payload)
ApiCall::Create.new(self, payload: payload).execute
end