Class: ImageNode

Inherits:
Object
  • Object
show all
Defined in:
lib/textile/nodes.rb

Instance Method Summary collapse

Constructor Details

#initialize(src) ⇒ ImageNode

Returns a new instance of ImageNode.



63
64
65
# File 'lib/textile/nodes.rb', line 63

def initialize(src)
  @src = src
end

Instance Method Details

#buildObject



67
68
69
70
71
72
73
# File 'lib/textile/nodes.rb', line 67

def build
  output = []
  output << '<img src="'
  output << transform_src
  output << '"/>'
  output.join('')
end

#transform_srcObject

Hook for booru monkeypatch



76
77
78
# File 'lib/textile/nodes.rb', line 76

def transform_src
  CGI.escapeHTML(@src)
end