Class: Reviewer::Output::Token
- Inherits:
-
Object
- Object
- Reviewer::Output::Token
- Defined in:
- lib/reviewer/output/token.rb
Overview
Simple class for streamlining the output of ‘tokens’ representing a style and content
Constant Summary collapse
- ESC =
"\e["
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#style ⇒ Object
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(style, content) ⇒ Token
constructor
A new instance of Token.
- #to_s ⇒ Object
Constructor Details
#initialize(style, content) ⇒ Token
Returns a new instance of Token.
14 15 16 17 |
# File 'lib/reviewer/output/token.rb', line 14 def initialize(style, content) @style = style @content = content end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
12 13 14 |
# File 'lib/reviewer/output/token.rb', line 12 def content @content end |
#style ⇒ Object
Returns the value of attribute style.
12 13 14 |
# File 'lib/reviewer/output/token.rb', line 12 def style @style end |
Instance Method Details
#to_s ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/reviewer/output/token.rb', line 19 def to_s [ style_string, content, reset_string ].join end |