Class: Spinebox::Generator::Controller

Inherits:
Object
  • Object
show all
Defined in:
lib/spinebox/generator.rb

Overview

Generates a controller

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Controller

Returns a new instance of Controller.



60
61
62
63
64
# File 'lib/spinebox/generator.rb', line 60

def initialize name
  @name, @source_name, @view_name = name.pluralize.camelize, name.pluralize, name.singularize
  compile_template
  write_source
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



55
56
57
# File 'lib/spinebox/generator.rb', line 55

def name
  @name
end

#sourceObject (readonly)

Returns the value of attribute source.



56
57
58
# File 'lib/spinebox/generator.rb', line 56

def source
  @source
end

#source_nameObject (readonly)

Returns the value of attribute source_name.



57
58
59
# File 'lib/spinebox/generator.rb', line 57

def source_name
  @source_name
end