Top Level Namespace

Defined Under Namespace

Modules: Hubba

Instance Method Summary collapse

Instance Method Details

#save_json(path, data) ⇒ Object

helpers



8
9
10
11
12
# File 'lib/hubba.rb', line 8

def save_json( path, data )    ## data - hash or array
  File.open( path, 'w:utf-8' ) do |f|
    f.write( JSON.pretty_generate( data ))
  end
end

#save_yaml(path, data) ⇒ Object



14
15
16
17
18
# File 'lib/hubba.rb', line 14

def save_yaml( path, data )
  File.open( path, 'w:utf-8' ) do |f|
    f.write( data.to_yaml )
  end
end