Class: JamScriptHighlighter::Line
- Inherits:
-
Object
- Object
- JamScriptHighlighter::Line
- Defined in:
- lib/jam_script_highlighter/line.rb
Direct Known Subclasses
JamScriptHighlighter::LineTypes::ControlLine, JamScriptHighlighter::LineTypes::EmptyLine, JamScriptHighlighter::LineTypes::MetadataLine, JamScriptHighlighter::LineTypes::NoteLine, JamScriptHighlighter::LineTypes::OtherLine, JamScriptHighlighter::LineTypes::SectionLine, JamScriptHighlighter::LineTypes::TitleLine, JamScriptHighlighter::LineTypes::VariationLine
Instance Attribute Summary collapse
-
#text ⇒ Object
Returns the value of attribute text.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#text ⇒ Object
Returns the value of attribute text.
3 4 5 |
# File 'lib/jam_script_highlighter/line.rb', line 3 def text @text end |
Class Method Details
.new(text, type = nil) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/jam_script_highlighter/line.rb', line 10 def new text, type=nil if type class_name = "#{type.to_s.split('_').map{|e| e.capitalize}.join}Line" cls = JamScriptHighlighter::LineTypes.const_get(class_name) cls.new text else ret = super() ret.text = text ret end end |
Instance Method Details
#to_html ⇒ Object
5 6 7 |
# File 'lib/jam_script_highlighter/line.rb', line 5 def to_html @text || '' end |