class Organismo::Element::Image
Attributes
content[R]
location[R]
Public Class Methods
new(img_url, location)
click to toggle source
# File lib/organismo/element/image.rb, line 5 def initialize(img_url, location) @content = remove_tag(img_url) @location = location end
Public Instance Methods
convert_to_html()
click to toggle source
# File lib/organismo/element/image.rb, line 10 def convert_to_html "<img src='#{content}'/>" end
Private Instance Methods
remove_tag(img_url)
click to toggle source
# File lib/organismo/element/image.rb, line 16 def remove_tag(img_url) result = img_url && img_url.strip.split(/\[\[|\]\]/).last CGI.escapeHTML(result) end