Class: Plate::ImageNode

Inherits:
AttributableNode show all
Defined in:
lib/plate/nodes.rb,
lib/plate/compiler.rb

Instance Attribute Summary collapse

Attributes inherited from AttributableNode

#attributes

Instance Method Summary collapse

Methods inherited from AttributableNode

#compile_attributes

Methods included from Inspector

#inspect_with

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

#srcObject

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



248
249
250
251
# File 'lib/plate/compiler.rb', line 248

def compile(compiler, parent = nil)
  attr = compile_attributes(compiler)
  "<img src=\"#{src.compile(compiler)}\"#{attr} />"
end

#inspectObject



103
104
105
# File 'lib/plate/nodes.rb', line 103

def inspect
  inspect_with([src])
end