Module: Granite::Action::Projectors::ClassMethods

Defined in:
lib/granite/action/projectors.rb

Instance Method Summary collapse

Instance Method Details

#_projectorsObject



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, options = {}, &block)
  _projectors.store(name, options, &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_namesObject



80
81
82
# File 'lib/granite/action/projectors.rb', line 80

def projector_names
  _projectors.names
end