Class: Vmaps::Main

Inherits:
Object
  • Object
show all
Defined in:
lib/vmaps.rb

Instance Method Summary collapse

Constructor Details

#initialize(source = nil) ⇒ Main

Returns a new instance of Main.



7
8
9
10
11
12
13
14
15
# File 'lib/vmaps.rb', line 7

def initialize(source=nil)
  if source == nil
    puts "No source given."
    exit 1
  end
  parser = Parser.new(source)

  @mappings = parser.parse_to_mappings()
end

Instance Method Details

#output_jsonObject



17
18
19
# File 'lib/vmaps.rb', line 17

def output_json
  puts JSON.dump @mappings
end