Class: Auth::Generators::RouteGenerator

Inherits:
Rails::Generator::NamedBase
  • Object
show all
Defined in:
lib/auth/generators/route_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model, options = {}) ⇒ RouteGenerator

Returns a new instance of RouteGenerator.



4
5
6
7
8
# File 'lib/auth/generators/route_generator.rb', line 4

def initialize(model, options = {})
  @model = model
  args = [ model.name ]
  super(args, options)
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



2
3
4
# File 'lib/auth/generators/route_generator.rb', line 2

def model
  @model
end

Instance Method Details

#manifestObject



10
11
12
13
14
# File 'lib/auth/generators/route_generator.rb', line 10

def manifest
  record do |m|
    m.route_resources plural_name
  end
end

#specObject



16
17
18
# File 'lib/auth/generators/route_generator.rb', line 16

def spec
  @spec ||= Rails::Generator::Spec.new("route", File.join(Auth.path, "auth/generators"), nil)
end