Created
March 18, 2014 10:07
-
-
Save jodosha/9617112 to your computer and use it in GitHub Desktop.
Ruby's include tweaks for Lotus::Controller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Coded for: | |
# https://github.com/lotus/controller/pull/7 | |
module Lotus | |
module Controller | |
module Dsl | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def action(name) | |
puts "Defined action: #{ name }" | |
end | |
end | |
end | |
include Dsl | |
end | |
end | |
class ArticlesController | |
include Lotus::Controller | |
end | |
Lotus::Controller.action('index') | |
ArticlesController.action('show') # => will raise NoMethodError |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment