Class: Processing::Inner
- Defined in:
- lib/ruby-processing/exporters/creator.rb
Overview
This class creates a ruby-processing class that mimics java inner class
Constant Summary
Constants inherited from Creator
Instance Method Summary collapse
-
#create!(path, _args_) ⇒ Object
Create a blank sketch, given a path.
- #inner_class_template ⇒ Object
Methods inherited from Creator
Instance Method Details
#create!(path, _args_) ⇒ Object
Create a blank sketch, given a path.
174 175 176 177 178 179 180 181 182 183 184 185 |
# File 'lib/ruby-processing/exporters/creator.rb', line 174 def create!(path, _args_) return usage if /\?/ =~ path || /--help/ =~ path main_file = File.basename(path, '.rb') # Check to make sure that the main file doesn't exist already already_exist(path) @param = { name: main_file.camelize, file_name: "#{File.dirname(path)}/#{path.underscore}.rb", title: main_file.titleize } SketchWriter.new(inner_class_template, @param) end |
#inner_class_template ⇒ Object
165 166 167 168 169 170 171 172 |
# File 'lib/ruby-processing/exporters/creator.rb', line 165 def inner_class_template %( class <%=@name%> include Processing::Proxy end ) end |