Class: Hikkoshi::Ghost::PostProcessor::TableDowngrader::Part
- Inherits:
-
Object
- Object
- Hikkoshi::Ghost::PostProcessor::TableDowngrader::Part
- Defined in:
- lib/hikkoshi/ghost/post_processor/table_downgrader.rb
Instance Attribute Summary collapse
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #<<(text) ⇒ Object
- #convert_table(text) ⇒ Object
- #converted_text ⇒ Object
-
#initialize(is_table:) ⇒ Part
constructor
A new instance of Part.
- #table? ⇒ Boolean
Constructor Details
#initialize(is_table:) ⇒ Part
Returns a new instance of Part.
38 39 40 41 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 38 def initialize(is_table:) @text = "" @is_table = is_table end |
Instance Attribute Details
#text ⇒ Object (readonly)
Returns the value of attribute text.
36 37 38 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 36 def text @text end |
Instance Method Details
#<<(text) ⇒ Object
47 48 49 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 47 def <<(text) @text << text end |
#convert_table(text) ⇒ Object
60 61 62 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 60 def convert_table(text) CONVERTER.render(text) end |
#converted_text ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 51 def converted_text if self.table? # TODO: make this optional convert_table(@text) + "\n<!--\n#{@text}\n-->\n" else @text end end |
#table? ⇒ Boolean
43 44 45 |
# File 'lib/hikkoshi/ghost/post_processor/table_downgrader.rb', line 43 def table? @is_table end |