Module: Appfuel::Config::Search
- Included in:
- DefinitionDsl
- Defined in:
- lib/appfuel/config/search.rb
Instance Method Summary collapse
-
#[](name) ⇒ Object
Allow you to access child definitions as if it were a hash.
-
#search(*names) ⇒ Object
Allows you to search child definitions using an array of names instead of a space separated string.
Instance Method Details
#[](name) ⇒ Object
Allow you to access child definitions as if it were a hash. If you add a space separated list of names this will traverse the child hierarchy and return the last name in the list
10 11 12 |
# File 'lib/appfuel/config/search.rb', line 10 def [](name) find @children, name.to_s.split(" ") end |
#search(*names) ⇒ Object
Allows you to search child definitions using an array of names instead of a space separated string
19 20 21 22 |
# File 'lib/appfuel/config/search.rb', line 19 def search(*names) return nil if names.empty? find children, names end |