Module: Cased::Model::ClassMethods

Defined in:
lib/cased/model.rb

Instance Method Summary collapse

Instance Method Details

#cased_categorySymbol

Establishes a default ‘cased_category` that matches nicely to the class name. The default instance level `cased_category` uses this.

Returns:

  • (Symbol)


17
18
19
20
21
22
# File 'lib/cased/model.rb', line 17

def cased_category
  @cased_category ||= begin
    category = ActiveSupport::Inflector.underscore(name)
    category.to_sym
  end
end