class Brainstem::ApiDocs::Sinks::StdoutSink

Attributes

puts_method[W]

Storage for holding the writing method.

Public Instance Methods

<<(output) click to toggle source

Writes the output using stdout.puts.

# File lib/brainstem/api_docs/sinks/stdout_sink.rb, line 11
def <<(output)
  puts_method.call(output)
end

Private Instance Methods

puts_method() click to toggle source

Callable method for writing data to a buffer (by default stdout).

@return [Proc] a method which writes data to a buffer when called.

# File lib/brainstem/api_docs/sinks/stdout_sink.rb, line 33
def puts_method
  @puts_method ||= $stdout.method(:puts)
end
valid_options() click to toggle source
# File lib/brainstem/api_docs/sinks/stdout_sink.rb, line 19
def valid_options
  super | [ :puts_method ]
end