Class: RSpec::Interactive::StringOutput

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec-interactive/string_output.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeStringOutput

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

#stringObject (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

#closeObject



37
38
# File 'lib/rspec-interactive/string_output.rb', line 37

def close
end

#closed?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/rspec-interactive/string_output.rb', line 25

def closed?
  @client.closed?
end

#flushObject



22
23
# File 'lib/rspec-interactive/string_output.rb', line 22

def flush
end


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

#syncObject



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