Class: Merb::Generators::NamedGenerator

Inherits:
Generator
  • Object
show all
Defined in:
lib/merb-gen/named_generator.rb

Instance Method Summary collapse

Methods inherited from Generator

#go_up, source_root, #with_modules

Methods included from ColorfulMessages

#error, #success, #warning

Constructor Details

#initialize(*args) ⇒ NamedGenerator

Returns a new instance of NamedGenerator.



9
10
11
# File 'lib/merb-gen/named_generator.rb', line 9

def initialize(*args)
  super
end

Instance Method Details

#class_nameObject Also known as: module_name



13
14
15
# File 'lib/merb-gen/named_generator.rb', line 13

def class_name
  name.gsub('-', '_').camel_case
end

#file_nameObject Also known as: base_name



23
24
25
# File 'lib/merb-gen/named_generator.rb', line 23

def file_name
  name.snake_case
end

#symbol_nameObject



29
30
31
# File 'lib/merb-gen/named_generator.rb', line 29

def symbol_name
  file_name.gsub('-', '_')
end

#test_class_nameObject



19
20
21
# File 'lib/merb-gen/named_generator.rb', line 19

def test_class_name
  class_name + "Test"
end