Class: CSquare::Generator::Enum::Namer
- Inherits:
-
Object
- Object
- CSquare::Generator::Enum::Namer
- Defined in:
- lib/csquare/generator/enum/namer.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(prefix) ⇒ Namer
constructor
A new instance of Namer.
- #name(arg) ⇒ Object
- #num(arg) ⇒ Object
Constructor Details
#initialize(prefix) ⇒ Namer
Returns a new instance of Namer.
2 3 4 |
# File 'lib/csquare/generator/enum/namer.rb', line 2 def initialize prefix @prefix = prefix end |
Instance Method Details
#name(arg) ⇒ Object
6 7 8 |
# File 'lib/csquare/generator/enum/namer.rb', line 6 def name arg @prefix.nil? ? arg.to_s.upcase : "#{@prefix.upcase}_#{arg.to_s.upcase}" end |
#num(arg) ⇒ Object
10 11 12 |
# File 'lib/csquare/generator/enum/namer.rb', line 10 def num arg :auto end |