Module: Roast::Cog::Output::WithText

Included in:
Roast::Cogs::Agent::Output, Roast::Cogs::Chat::Output, Roast::Cogs::Cmd::Output
Defined in:
lib/roast/cog/output.rb

Overview

@requires_ancestor: Roast::Cog::Output

Instance Method Summary collapse

Instance Method Details

#linesObject

Get the output as an array of lines with each line’s whitespace stripped

This method splits the output into individual lines and removes leading and trailing whitespace from each line.

#### See Also

  • ‘text`

: () -> Array



287
288
289
# File 'lib/roast/cog/output.rb', line 287

def lines
  raw_text.lines.map(&:strip)
end

#textObject

Get the output as a single string with surrounding whitespace removed

This method returns the text output with leading and trailing whitespace stripped.

#### See Also

  • ‘lines`

: () -> String



274
275
276
# File 'lib/roast/cog/output.rb', line 274

def text
  raw_text.strip
end