Class: String
- Inherits:
-
Object
- Object
- String
- Includes:
- Term::ANSIColor
- Defined in:
- lib/peto/master.rb,
lib/peto/generator.rb
Instance Method Summary collapse
- #to_as_class_type ⇒ Object
- #to_class_type(language) ⇒ Object
- #to_method_name ⇒ Object
- #to_rb_class_type ⇒ Object
Instance Method Details
#to_as_class_type ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/peto/generator.rb', line 19 def to_as_class_type case self when "integer" "int" when "Number" "int" when "Boolean" "Boolean" when "string" "String" when "array" "Array" else self.capitalize end end |
#to_class_type(language) ⇒ Object
35 36 37 |
# File 'lib/peto/generator.rb', line 35 def to_class_type(language) send(:"to_#{language}_class_type") end |
#to_method_name ⇒ Object
8 9 10 |
# File 'lib/peto/generator.rb', line 8 def to_method_name underscore.split(" ").join("_") end |
#to_rb_class_type ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/peto/generator.rb', line 11 def to_rb_class_type case self when "integer" "Fixnum" else classify end end |