Module: Praxis::Controller::ClassMethods

Defined in:
lib/praxis/controller.rb

Instance Method Summary collapse

Instance Method Details

#idObject



26
27
28
# File 'lib/praxis/controller.rb', line 26

def id
  self.name.gsub('::'.freeze,'-'.freeze)
end

#implements(definition) ⇒ Object



17
18
19
20
21
22
23
24
# File 'lib/praxis/controller.rb', line 17

def implements(definition)
  define_singleton_method(:definition) do
    definition
  end

  definition.controller = self
  Application.instance.controllers << self
end