Class: Mystique::PresenterClass
- Inherits:
-
Object
- Object
- Mystique::PresenterClass
- Defined in:
- lib/mystique/presenter_class.rb
Instance Method Summary collapse
- #class_name ⇒ Object
-
#initialize(object, with = nil) ⇒ PresenterClass
constructor
A new instance of PresenterClass.
- #to_class ⇒ Object
Constructor Details
#initialize(object, with = nil) ⇒ PresenterClass
Returns a new instance of PresenterClass.
3 4 5 6 |
# File 'lib/mystique/presenter_class.rb', line 3 def initialize(object, with=nil) @with = with @object = object end |
Instance Method Details
#class_name ⇒ Object
12 13 14 15 16 |
# File 'lib/mystique/presenter_class.rb', line 12 def class_name return with.to_s if with "#{base_class_name(object)}Presenter" end |
#to_class ⇒ Object
8 9 10 |
# File 'lib/mystique/presenter_class.rb', line 8 def to_class with || Object.send(:const_get, class_name) end |