Class: SuperDiff::RSpec::MatcherTextTemplate::ColorizedText
- Defined in:
- lib/super_diff/rspec/matcher_text_template.rb
Instance Method Summary collapse
-
#initialize(color) ⇒ ColorizedText
constructor
A new instance of ColorizedText.
- #length ⇒ Object
- #to_s ⇒ Object
Methods inherited from Text
#to_string_in_multiline_mode, #to_string_in_singleline_mode
Methods inherited from Base
#to_string_in_multiline_mode, #to_string_in_singleline_mode
Constructor Details
#initialize(color) ⇒ ColorizedText
Returns a new instance of ColorizedText.
139 140 141 142 143 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 139 def initialize(color, ...) super(...) @color = color end |
Instance Method Details
#length ⇒ Object
149 150 151 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 149 def length evaluate.to_s.length end |
#to_s ⇒ Object
145 146 147 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 145 def to_s colorizer.wrap(evaluate.to_s, color) end |