Class: Concrete
Overview
Takes an ActionScript 3 Interface file and generates a concrete implementation from it.
Constant Summary
Constants inherited from Tool
Instance Method Summary collapse
-
#generate(file) ⇒ Object
Parse the Interface and outputs the concrete document.
-
#initialize(opt, out = STDOUT) ⇒ Concrete
constructor
A new instance of Concrete.
-
#valid_opts ⇒ Object
Valid if an Interface has been supplied in the options.
Methods inherited from Tool
#add_sigint_handler, #generated_at, #log, #puts, #to_disk
Constructor Details
#initialize(opt, out = STDOUT) ⇒ Concrete
Returns a new instance of Concrete.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/shed/concrete.rb', line 8 def initialize(opt,out=STDOUT) super(opt,out) @interface = opt[:interface] do_exit unless valid_opts create_mixer(opt[:type]) generate(File.new(@interface).read) end |
Instance Method Details
#generate(file) ⇒ Object
Parse the Interface and outputs the concrete document.
29 30 31 32 |
# File 'lib/shed/concrete.rb', line 29 def generate(file) @parser = Interface.new(file) rescue do_exit output end |
#valid_opts ⇒ Object
Valid if an Interface has been supplied in the options.
22 23 24 |
# File 'lib/shed/concrete.rb', line 22 def valid_opts File.exist?(@interface) rescue false end |