Class: SsSyntax::Parse
- Inherits:
-
Object
- Object
- SsSyntax::Parse
- Defined in:
- lib/ss_syntax/parse.rb
Instance Attribute Summary collapse
-
#characters ⇒ Object
readonly
Returns the value of attribute characters.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(text) ⇒ Parse
constructor
A new instance of Parse.
- #to_h ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(text) ⇒ Parse
Returns a new instance of Parse.
12 13 14 15 16 |
# File 'lib/ss_syntax/parse.rb', line 12 def initialize(text) @text = text @charactes = {} @parse_text = parse_text end |
Instance Attribute Details
#characters ⇒ Object (readonly)
Returns the value of attribute characters.
10 11 12 |
# File 'lib/ss_syntax/parse.rb', line 10 def characters @characters end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
10 11 12 |
# File 'lib/ss_syntax/parse.rb', line 10 def text @text end |
Instance Method Details
#to_h ⇒ Object
22 23 24 25 26 27 28 29 30 |
# File 'lib/ss_syntax/parse.rb', line 22 def to_h html_text = '' @parse_text.each_line do |line| line.chomp! html_text += "<span>#{line}</span><br />" end html_text end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/ss_syntax/parse.rb', line 18 def to_s @parse_text end |