lib/base_presenter.rb in base_presenter-0.0.1 vs lib/base_presenter.rb in base_presenter-0.0.2
- old
+ new
@@ -1,5 +1,20 @@
require "base_presenter/version"
class BasePresenter
- # Your code goes here...
+
+ def initialize(object, template)
+ @object = object
+ @template = template
+ end
+
+ def self.presents(name)
+ define_method(name) do
+ @object
+ end
+ end
+
+ def method_missing(*args, &block)
+ @template.send(*args, &block)
+ end
+
end