Permalink
Browse files

Make constant uppercase

  • Loading branch information...
1 parent 4702de2 commit 375cb53c1a7747f7669b36ea63d94a357bc4c5b5 @ttencate committed Jan 15, 2012
Showing with 3 additions and 5 deletions.
  1. +1 −3 lib/blimp/handler.rb
  2. +1 −1 lib/blimp/handlers/page_handler.rb
  3. +1 −1 lib/blimp/handlers/static_handler.rb
View
4 lib/blimp/handler.rb
@@ -3,12 +3,10 @@ class Handler
class NotFound < StandardError; end
class << self
- attr_reader :name
-
def find_by_name(name)
for constant in Blimp::Handlers.constants do
handler = Blimp::Handlers.const_get(constant)
- return handler if handler < Blimp::Handler && handler.name == name
+ return handler if handler < Blimp::Handler && handler::NAME == name
end
raise NotFound, "No handler found for name #{name}"
end
View
2 lib/blimp/handlers/page_handler.rb
@@ -1,7 +1,7 @@
module Blimp
module Handlers
class PageHandler < Blimp::Handler
- @name = "page"
+ NAME = "page"
end
end
end
View
2 lib/blimp/handlers/static_handler.rb
@@ -1,7 +1,7 @@
module Blimp
module Handlers
class StaticHandler < Blimp::Handler
- @name = "static"
+ NAME = "static"
def handle(source, path, params = {})
resource = Static.from_path(path, source)

0 comments on commit 375cb53

Please sign in to comment.