Class: Merb::Generators::NamedGenerator

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

Direct Known Subclasses

AppGenerator, NamespacedGenerator

Instance Method Summary (collapse)

Methods inherited from Generator

#go_up, source_root, #with_modules

Methods included from ColorfulMessages

#error, #success, #warning

Constructor Details

- (NamedGenerator) initialize(*args)

Returns a new instance of NamedGenerator



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

def initialize(*args)
  super
end

Instance Method Details

- (Object) class_name Also known as: module_name



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

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

- (Object) file_name Also known as: base_name



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

def file_name
  name.snake_case
end

- (Object) symbol_name



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

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

- (Object) test_class_name



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

def test_class_name
  class_name + "Test"
end