Class: RSpec::Interactive::StringOutput
- Inherits:
-
Object
- Object
- RSpec::Interactive::StringOutput
- Defined in:
- lib/rspec-interactive/string_output.rb
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
- #close ⇒ Object
- #closed? ⇒ Boolean
- #flush ⇒ Object
-
#initialize ⇒ StringOutput
constructor
A new instance of StringOutput.
- #print(str = "") ⇒ Object
- #puts(str = "") ⇒ Object
- #sync ⇒ Object
- #sync=(sync) ⇒ Object
- #write(name, str = "") ⇒ Object
Constructor Details
#initialize ⇒ StringOutput
Returns a new instance of StringOutput.
6 7 8 |
# File 'lib/rspec-interactive/string_output.rb', line 6 def initialize @string = '' end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
4 5 6 |
# File 'lib/rspec-interactive/string_output.rb', line 4 def string @string end |
Instance Method Details
#close ⇒ Object
37 38 |
# File 'lib/rspec-interactive/string_output.rb', line 37 def close end |
#closed? ⇒ Boolean
25 26 27 |
# File 'lib/rspec-interactive/string_output.rb', line 25 def closed? @client.closed? end |
#flush ⇒ Object
22 23 |
# File 'lib/rspec-interactive/string_output.rb', line 22 def flush end |
#print(str = "") ⇒ Object
18 19 20 |
# File 'lib/rspec-interactive/string_output.rb', line 18 def print(str = "") @string += str.to_s end |
#puts(str = "") ⇒ Object
14 15 16 |
# File 'lib/rspec-interactive/string_output.rb', line 14 def puts(str = "") @string += str.to_s + "\n" end |
#sync ⇒ Object
29 30 31 |
# File 'lib/rspec-interactive/string_output.rb', line 29 def sync @sync || false end |
#sync=(sync) ⇒ Object
33 34 35 |
# File 'lib/rspec-interactive/string_output.rb', line 33 def sync=(sync) @sync = sync end |
#write(name, str = "") ⇒ Object
10 11 12 |
# File 'lib/rspec-interactive/string_output.rb', line 10 def write(name, str = "") @string += str.to_s end |