Class: Wunderbar::ScriptNode
- Inherits:
-
CDATANode
- Object
- Node
- PreformattedNode
- CDATANode
- Wunderbar::ScriptNode
- Defined in:
- lib/wunderbar/node.rb,
lib/wunderbar/script.rb
Constant Summary
Constants inherited from Node
Instance Attribute Summary collapse
-
#binding ⇒ Object
Returns the value of attribute binding.
-
#block ⇒ Object
Returns the value of attribute block.
Attributes inherited from Node
#attrs, #children, #name, #node, #parent, #text
Instance Method Summary collapse
Methods inherited from CDATANode
Methods inherited from PreformattedNode
Methods inherited from Node
#add_child, #at, #initialize, #method_missing, parse_css_selector, #preserve_spaces?, #root, #search, #walk
Constructor Details
This class inherits a constructor from Wunderbar::Node
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Wunderbar::Node
Instance Attribute Details
#binding ⇒ Object
Returns the value of attribute binding.
10 11 12 |
# File 'lib/wunderbar/script.rb', line 10 def binding @binding end |
#block ⇒ Object
Returns the value of attribute block.
10 11 12 |
# File 'lib/wunderbar/script.rb', line 10 def block @block end |
Instance Method Details
#post ⇒ Object
352 |
# File 'lib/wunderbar/node.rb', line 352 def post; "//]]>"; end |
#pre ⇒ Object
351 |
# File 'lib/wunderbar/node.rb', line 351 def pre; "//<![CDATA["; end |
#serialize(options, result, indent) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/wunderbar/script.rb', line 11 def serialize(, result, indent) if @block and @children.empty? and not @text width = [:width] width -= indent.to_s.length if width @text = Ruby2JS.convert(@block, binding: @binding, width: width) end super end |