Class: BeerList::EstablishmentGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/establishment_generator.rb

Constant Summary collapse

DEFAULT_URL =
'http://yourestablishment.com/path/to/the/beer_list'
TEMPLATE_FILE =
File.expand_path('../templates/establishment.erb', __FILE__)
ESTABLISHMENTS_DIR =
File.expand_path('../../beer_list/establishments', __FILE__)

Instance Method Summary collapse

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