aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGibheer <gibheer@gmail.com>2012-11-17 09:25:05 +0100
committerGibheer <gibheer@gmail.com>2012-11-20 20:37:10 +0100
commitd7c217bd3057b18c8c2dff12e0a5974719185b68 (patch)
tree84ef7d36d564cdc945806585167533fa493cae1e /lib
parent2e073a07fac3978b28ef348c4c73d17ca68d0722 (diff)
make class functions more clear in renderer
Diffstat (limited to 'lib')
-rw-r--r--lib/zero/renderer.rb46
1 files changed, 24 insertions, 22 deletions
diff --git a/lib/zero/renderer.rb b/lib/zero/renderer.rb
index 740d156..3ae515b 100644
--- a/lib/zero/renderer.rb
+++ b/lib/zero/renderer.rb
@@ -14,30 +14,32 @@ module Zero
# The call to #render will return the String representation of the template
# with all data given.
class Renderer
- # set a base path for template search
- # @param path [String] the path to the template base dir
- def self.template_path=(path)
- @@path = path + '/'
- end
+ class << self
+ # set a base path for template search
+ # @param path [String] the path to the template base dir
+ def template_path=(path)
+ @@path = path + '/'
+ end
- # save a mapping hash for the type
- #
- # With that it is possible to map long and complex contant types to simpler
- # representations. These get then used in the finding process for the best
- # fitting template.
- #
- # @example
- # Zero::Renderer.map = {'text/html' => 'html'}
- #
- # @param map [Hash] maps the content type to a simple representation
- def self.type_map=(map)
- @@map = map
- end
+ # save a mapping hash for the type
+ #
+ # With that it is possible to map long and complex contant types to simpler
+ # representations. These get then used in the finding process for the best
+ # fitting template.
+ #
+ # @example
+ # Zero::Renderer.map = {'text/html' => 'html'}
+ #
+ # @param map [Hash] maps the content type to a simple representation
+ def type_map=(map)
+ @@map = map
+ end
- # returns the type map
- # @return [Hash] the mapping for types
- def self.type_map
- @@map ||= {}
+ # returns the type map
+ # @return [Hash] the mapping for types
+ def type_map
+ @@map ||= {}
+ end
end
# take the path and render the template within the context