lib/mystique.rb in mystique-0.1.0 vs lib/mystique.rb in mystique-0.1.1

- old
+ new

@@ -3,24 +3,24 @@ require "string_plus" module Mystique class Presenter def initialize(object, context) - @__obj__ = object - @__ctx__ = context + @__object__ = object + @__context__ = context end def self.present(object) new(object, context) end def h - @__ctx__ || self.class.context + @__context__ || self.class.context end def target - @__obj__ + @__object__ end private def method_missing(method, *args, &block) @@ -74,12 +74,12 @@ class Undefined; end module_function - def present(object, presenter: nil) + def present(object, with: nil) from_module &&= "#{from_module.to_s.camelcase}::" - presenter_class = case presenter + presenter_class = case with when nil "#{object.class}Presenter".constantize when Symbol, String "#{presenter}Presenter".constantize else