Class: Processing::Inner

Inherits:
Creator show all
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

Creator::ALL_DIGITS

Instance Method Summary collapse

Methods inherited from Creator

#already_exist, #usage

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_templateObject



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