Class: Reviewer::Output::Token

Inherits:
Object
  • Object
show all
Defined in:
lib/reviewer/output/token.rb

Overview

Simple class for streamlining the output of ‘tokens’ representing a style and content

Author:

  • garrettdimon

Constant Summary collapse

ESC =
"\e["

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#contentObject

Returns the value of attribute content.



12
13
14
# File 'lib/reviewer/output/token.rb', line 12

def content
  @content
end

#styleObject

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_sObject



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