lib/loquor/representation.rb in loquor-0.0.1 vs lib/loquor/representation.rb in loquor-0.0.2
- old
+ new
@@ -1,10 +1,9 @@
module Loquor
module Representation
module ClassMethods
-
- [:find, :where].each do |proxy|
+ [:find, :where, :create].each do |proxy|
define_method proxy do |*args|
new.send proxy, *args
end
end
end
@@ -14,9 +13,13 @@
ApiCall::Show.new(self.class.path, id).execute
end
def where(*args)
ApiCall::Index.new(self.class.path).where(*args)
+ end
+
+ def create(payload)
+ ApiCall::Create.new(self.class.path, payload).execute
end
end
end
end