Class: Rubysmith::Renderers::Namespace
- Inherits:
-
Object
- Object
- Rubysmith::Renderers::Namespace
- Defined in:
- lib/rubysmith/renderers/namespace.rb
Overview
Renders single or multiple modules with correct, two-space indentation for templates.
Instance Method Summary collapse
- #call(content) ⇒ Object
-
#initialize(namespace) ⇒ Namespace
constructor
A new instance of Namespace.
Constructor Details
#initialize(namespace) ⇒ Namespace
Returns a new instance of Namespace.
11 12 13 14 15 |
# File 'lib/rubysmith/renderers/namespace.rb', line 11 def initialize namespace @namespace = namespace @modules = namespace.split "::" @depth = namespace.scan("::").length end |
Instance Method Details
#call(content) ⇒ Object
17 |
# File 'lib/rubysmith/renderers/namespace.rb', line 17 def call(content) = "#{prefix}#{body content}#{suffix.chomp}" |