Class: Image
- Inherits:
-
DocItem
- Object
- TextLineBuilderContext
- TextLine
- DocItem
- Image
- Defined in:
- lib/almirah/doc_items/image.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
Returns the value of attribute path.
-
#text ⇒ Object
Returns the value of attribute text.
Attributes inherited from DocItem
Instance Method Summary collapse
- #getTextWithoutSpaces ⇒ Object
-
#initialize(text, path) ⇒ Image
constructor
A new instance of Image.
- #to_html ⇒ Object
Methods inherited from DocItem
Methods inherited from TextLine
add_lazy_doc_id, #bold, #bold_and_italic, #format_string, #italic, #link
Methods inherited from TextLineBuilderContext
#bold, #bold_and_italic, #italic, #link
Constructor Details
#initialize(text, path) ⇒ Image
Returns a new instance of Image.
8 9 10 11 |
# File 'lib/almirah/doc_items/image.rb', line 8 def initialize(text, path) @text = text @path = path end |
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
6 7 8 |
# File 'lib/almirah/doc_items/image.rb', line 6 def path @path end |
#text ⇒ Object
Returns the value of attribute text.
5 6 7 |
# File 'lib/almirah/doc_items/image.rb', line 5 def text @text end |
Instance Method Details
#getTextWithoutSpaces ⇒ Object
13 14 15 |
# File 'lib/almirah/doc_items/image.rb', line 13 def getTextWithoutSpaces return @text.split.join('-') end |
#to_html ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/almirah/doc_items/image.rb', line 17 def to_html s = '' if @@html_table_render_in_progress s += "</table>\n" @@html_table_render_in_progress = false end s += "<p style=\"margin-top: 15px;\"><img src=\"#{@path}\" alt=\"#{@text}\" " s += "href=\"javascript:void(0)\" onclick=\"image_OnClick(this)\">" return s end |