Class: SuperDiff::RSpec::MatcherTextTemplate::ColorizedText
- Defined in:
- lib/super_diff/rspec/matcher_text_template.rb
Instance Method Summary collapse
-
#initialize(color, *args, &block) ⇒ 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, *args, &block) ⇒ ColorizedText
Returns a new instance of ColorizedText.
144 145 146 147 148 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 144 def initialize(color, *args, &block) super(*args, &block) @color = color end |
Instance Method Details
#length ⇒ Object
154 155 156 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 154 def length evaluate.to_s.length end |
#to_s ⇒ Object
150 151 152 |
# File 'lib/super_diff/rspec/matcher_text_template.rb', line 150 def to_s colorizer.wrap(evaluate.to_s, color) end |