Module: Evil::Client::Formatter::Text

Extended by:
Text
Included in:
Text
Defined in:
lib/evil/client/formatter/text.rb

Overview

Utility module to format data as a single text

Instance Method Summary collapse

Instance Method Details

#call(source) ⇒ String

Formats data as a text

Parameters:

  • source (Object)

Returns:

  • (String)


13
14
15
16
17
18
19
# File 'lib/evil/client/formatter/text.rb', line 13

def call(source)
  case source
  when File, Tempfile then source.read
  when StringIO       then source.string
  else source.to_s
  end
end