Class: Bdd::StringBuilder
- Inherits:
-
Object
- Object
- Bdd::StringBuilder
- Defined in:
- lib/bdd/string_builder.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #append_failure(string) ⇒ Object
- #append_pending(string) ⇒ Object
- #append_success(string) ⇒ Object
-
#initialize(string) ⇒ StringBuilder
constructor
A new instance of StringBuilder.
Constructor Details
#initialize(string) ⇒ StringBuilder
Returns a new instance of StringBuilder.
5 6 7 |
# File 'lib/bdd/string_builder.rb', line 5 def initialize(string) @string = Colors.add(Title.adjust(string), :white, :bold) end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
3 4 5 |
# File 'lib/bdd/string_builder.rb', line 3 def string @string end |
Instance Method Details
#append_failure(string) ⇒ Object
17 18 19 |
# File 'lib/bdd/string_builder.rb', line 17 def append_failure(string) @string << Colors.add(string, :red) end |
#append_pending(string) ⇒ Object
13 14 15 |
# File 'lib/bdd/string_builder.rb', line 13 def append_pending(string) @string << Colors.add(string, :yellow) end |
#append_success(string) ⇒ Object
9 10 11 |
# File 'lib/bdd/string_builder.rb', line 9 def append_success(string) @string << Colors.add(string, :green) end |