Class: DeadEndUnloaded::MiniStringIO

Inherits:
Object
  • Object
show all
Defined in:
lib/dead_end/core_ext.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(isatty: $stderr.isatty) ⇒ MiniStringIO

Returns a new instance of MiniStringIO.



10
11
12
13
# File 'lib/dead_end/core_ext.rb', line 10

def initialize(isatty: $stderr.isatty)
  @string = +""
  @isatty = isatty
end

Instance Attribute Details

#isattyObject (readonly)

Returns the value of attribute isatty.



15
16
17
# File 'lib/dead_end/core_ext.rb', line 15

def isatty
  @isatty
end

#stringObject (readonly)

Returns the value of attribute string.



20
21
22
# File 'lib/dead_end/core_ext.rb', line 20

def string
  @string
end

Instance Method Details

#puts(value = $/) ⇒ Object



16
17
18
# File 'lib/dead_end/core_ext.rb', line 16

def puts(value = $/, **)
  @string << value
end