Class: Toolsmith::Views::Base
- Inherits:
-
Object
- Object
- Toolsmith::Views::Base
- Defined in:
- lib/toolsmith/views/base.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
- #content_tag(*args, &block) ⇒ Object
-
#initialize(context, &block) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(context, &block) ⇒ Base
Returns a new instance of Base.
6 7 8 9 10 11 12 |
# File 'lib/toolsmith/views/base.rb', line 6 def initialize(context, &block) @context = context if block_given? block.arity > 0 ? block.call(self) : yield end end |
Instance Attribute Details
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/toolsmith/views/base.rb', line 4 def context @context end |
Instance Method Details
#content_tag(*args, &block) ⇒ Object
14 15 16 |
# File 'lib/toolsmith/views/base.rb', line 14 def content_tag(*args, &block) context.content_tag(*args, &block) end |