Class: Motoko::Formatters::BaseFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/motoko/formatters/base_formatter.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ BaseFormatter

Returns a new instance of BaseFormatter.



6
# File 'lib/motoko/formatters/base_formatter.rb', line 6

def initialize(options = {}) end

Instance Method Details

#format(value) ⇒ Object



8
9
10
11
12
13
14
15
16
17
# File 'lib/motoko/formatters/base_formatter.rb', line 8

def format(value)
  case value
  when Array
    value.join("\n")
  when Hash
    value.keys.join("\n")
  else
    value.to_s
  end
end