Class: Hexp::Builder::NodeBuilder Private
- Inherits:
-
Object
- Object
- Hexp::Builder::NodeBuilder
- Defined in:
- lib/hexp/builder.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Allow setting HTML classes through method calls
Instance Method Summary (collapse)
-
- (NodeBuilder) initialize(node, builder)
constructor
private
Create new NodeBuilder.
-
- (Hexp::Builder::NodeBuilder) method_missing(sym, &block)
Used for specifying CSS class names.
Constructor Details
- (NodeBuilder) initialize(node, builder)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create new NodeBuilder
185 186 187 |
# File 'lib/hexp/builder.rb', line 185 def initialize(node, builder) @node, @builder = node, builder end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
- (Hexp::Builder::NodeBuilder) method_missing(sym, &block)
Used for specifying CSS class names
199 200 201 202 203 204 |
# File 'lib/hexp/builder.rb', line 199 def method_missing(sym, &block) attrs = @node[1] @node[1] = attrs.merge class: [attrs[:class], sym.to_s].compact.join(' ') @builder._process(&block) if block self end |