Module: Granite::Action::Projectors::ClassMethods
- Defined in:
- lib/granite/action/projectors.rb
Instance Method Summary collapse
Instance Method Details
#_projectors ⇒ Object
76 77 78 |
# File 'lib/granite/action/projectors.rb', line 76 def _projectors @_projectors ||= ProjectorsCollection.new(self) end |
#projector(name, options = {}, &block) ⇒ Object
84 85 86 87 88 89 90 91 92 93 94 95 96 |
# File 'lib/granite/action/projectors.rb', line 84 def projector(name, = {}, &block) _projectors.store(name, , &block) class_eval " def self.\#{name}\n _projectors.fetch(:\#{name})\n end\n\n def \#{name}\n @\#{name} ||= self.class._projectors.fetch(:\#{name}).new(self)\n end\n METHOD\nend\n", __FILE__, __LINE__ + 1 |
#projector_names ⇒ Object
80 81 82 |
# File 'lib/granite/action/projectors.rb', line 80 def projector_names _projectors.names end |