Class: BeerList::EstablishmentGenerator
- Inherits:
-
Object
- Object
- BeerList::EstablishmentGenerator
- Defined in:
- lib/generators/establishment_generator.rb
Constant Summary collapse
- DEFAULT_URL =
'http://yourestablishment.com/path/to/the/beer_list'
- TEMPLATE_FILE =
File.('../templates/establishment.erb', __FILE__)
- ESTABLISHMENTS_DIR =
File.('../../beer_list/establishments', __FILE__)
Instance Method Summary collapse
-
#initialize(klass, args = {}) ⇒ EstablishmentGenerator
constructor
A new instance of EstablishmentGenerator.
Constructor Details
#initialize(klass, args = {}) ⇒ EstablishmentGenerator
Returns a new instance of EstablishmentGenerator.
10 11 12 13 14 15 16 |
# File 'lib/generators/establishment_generator.rb', line 10 def initialize(klass, args={}) @klass = klass @url = args[:url] || DEFAULT_URL @selector = args[:selector] || '.selector' @directory = args[:directory] || ESTABLISHMENTS_DIR write_file end |