Module: Suprdate::Utility::CleanConstantName

Included in:
Suprdate::Unit
Defined in:
lib/suprdate.rb

Overview

Some inflection on the #name of constants.

Instance Method Summary collapse

Instance Method Details

#name_pluralObject

Same as #name_singular with an ā€˜sā€™ added.



33
# File 'lib/suprdate.rb', line 33

def name_plural() name_singular + 's' end

#name_singularObject

Lowercase name without preceding namespace.



30
# File 'lib/suprdate.rb', line 30

def name_singular() name_without_namespace.downcase end

#to_symObject

Symbol of lowercase name without preceding namespace.



36
# File 'lib/suprdate.rb', line 36

def to_sym() name_singular.to_sym end