Class: Aspera::Cli::Flattener

Inherits:
Object
  • Object
show all
Defined in:
lib/aspera/cli/formatter.rb

Overview

This class is used to transform a complex structure into a simple hash

Instance Method Summary collapse

Constructor Details

#initialize(formatter) ⇒ Flattener

Returns a new instance of Flattener.



19
20
21
22
# File 'lib/aspera/cli/formatter.rb', line 19

def initialize(formatter)
  @result = nil
  @formatter = formatter
end

Instance Method Details

#flatten(something) ⇒ Object

General method



25
26
27
28
29
30
# File 'lib/aspera/cli/formatter.rb', line 25

def flatten(something)
  Aspera.assert_type(something, Hash)
  @result = {}
  flatten_any(something, '')
  return @result
end