class Embryo::RubyTemplate::Model
Public Class Methods
new(name)
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 6 def initialize(name) @name = name.singularize end
Public Instance Methods
class_name()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 26 def class_name @name.camelize end
path()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 10 def path @name.underscore end
plural()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 22 def plural singular.pluralize end
plural_class_name()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 30 def plural_class_name class_name.pluralize end
plural_path()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 14 def plural_path path.pluralize end
plural_symbol()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 38 def plural_symbol symbol.pluralize end
singular()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 18 def singular path.split("/").last end
symbol()
click to toggle source
# File lib/rails-embryo/ruby_template/model.rb, line 34 def symbol path.gsub("/", "_") end