Module: DeadSimpleCMS::Util::Identifier
- Extended by:
- ActiveSupport::Concern
- Included in:
- Attribute::Collection, Attribute::Type::Base, Group::Configuration
- Defined in:
- lib/dead_simple_cms/util/identifier.rb,
lib/dead_simple_cms/util/identifier/dictionary.rb
Overview
Public: A module for the convention of having an identifier:
* an identifier (Symbol)
* a label (default: titleize) to present to the world
* a collection for looking up items based on their `identifier`
We specifically got away from having a “name” as that usually leads to confusion. Is the name the “foo_bar” name or the pretty “Foo Bar” name?
Defined Under Namespace
Modules: ClassMethods Classes: Dictionary
Instance Method Summary collapse
Instance Method Details
#initialize(identifier, options = {}) ⇒ Object
20 21 22 23 24 |
# File 'lib/dead_simple_cms/util/identifier.rb', line 20 def initialize(identifier, ={}) @identifier = identifier.to_sym @label = [:label] || identifier.to_s.titleize super() end |