Class: Plate::ImageNode
- Inherits:
-
AttributableNode
- Object
- Struct
- AttributableNode
- Plate::ImageNode
- Defined in:
- lib/plate/nodes.rb,
lib/plate/compiler.rb
Instance Attribute Summary collapse
-
#src ⇒ Object
Returns the value of attribute src.
Attributes inherited from AttributableNode
Instance Method Summary collapse
- #compile(compiler, parent = nil) ⇒ Object
-
#initialize(src, attributes) ⇒ ImageNode
constructor
A new instance of ImageNode.
- #inspect ⇒ Object
Methods inherited from AttributableNode
Methods included from Inspector
Constructor Details
#initialize(src, attributes) ⇒ ImageNode
Returns a new instance of ImageNode.
98 99 100 101 |
# File 'lib/plate/nodes.rb', line 98 def initialize(src, attributes) self.src = src self.attributes = attributes end |
Instance Attribute Details
#src ⇒ Object
Returns the value of attribute src.
97 98 99 |
# File 'lib/plate/nodes.rb', line 97 def src @src end |
Instance Method Details
#compile(compiler, parent = nil) ⇒ Object
239 240 241 242 |
# File 'lib/plate/compiler.rb', line 239 def compile(compiler, parent = nil) attr = compile_attributes(compiler) "<img src=\"#{src.compile(compiler)}\"#{attr} />" end |
#inspect ⇒ Object
103 104 105 |
# File 'lib/plate/nodes.rb', line 103 def inspect inspect_with([src]) end |