Class: Wireframe::Application

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

Class Method Summary collapse

Class Method Details

.run!(*arguments) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/wireframe/application.rb', line 4

def run!(*arguments)
  if arguments.size != 3
    puts "usage: wireframe image <size> <output file>"
    exit 1
  end

  class_name, coordinates, output = arguments
  sketcher = Wireframe.const_get class_name.capitalize
  image = sketcher.new coordinates  
  File.open(output, 'w') {|f| f.write(image.draw)}
end