Module: Ronin::Model::HasUniqueName::ClassMethods
- Defined in:
- lib/ronin/model/has_unique_name.rb
Overview
Class methods that will be added when Ronin::Model::HasUniqueName is included.
Instance Method Summary collapse
-
#[](key) ⇒ Model?
Searches for models with the unique name.
Instance Method Details
#[](key) ⇒ Model?
Searches for models with the unique name.
67 68 69 70 71 72 73 74 |
# File 'lib/ronin/model/has_unique_name.rb', line 67 def [](key) case key when String, Symbol first(:name => key.to_s) else super(key) end end |