Class: SinatraHelpers::Generator::App
- Inherits:
-
Object
- Object
- SinatraHelpers::Generator::App
- Defined in:
- lib/sinatra_helpers/generator/app.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(path) ⇒ App
constructor
A new instance of App.
Constructor Details
#initialize(path) ⇒ App
Returns a new instance of App.
13 14 15 16 17 |
# File 'lib/sinatra_helpers/generator/app.rb', line 13 def initialize(path) @root_path = File.dirname(path) self.name = File.basename(path) @class_name = @name.classify end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
11 12 13 |
# File 'lib/sinatra_helpers/generator/app.rb', line 11 def name @name end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
11 12 13 |
# File 'lib/sinatra_helpers/generator/app.rb', line 11 def root_path @root_path end |
Instance Method Details
#generate ⇒ Object
23 24 25 |
# File 'lib/sinatra_helpers/generator/app.rb', line 23 def generate build_template(File.join(self.root_path, self.name), SinatraHelpers::Generator::TEMPLATE) end |