lib/iron/settings/cursor.rb
# Finds the item (group or entry) in the hierarchy matching the provided
# relative key.  Raises a RuntimeError on unknown keys.
Finds the item (group or entry) in the hierarchy matching the provided
relative key.  Raises a RuntimeError on unknown keys.
Finds the item ( group or entry ) in the hierarchy matching the provided relative key . Raises a RuntimeError on unknown keys .
def find_item(key)
      item = @group
      key = key.to_s
      parts = key.split(/\./)
      until parts.empty?
        item_key = parts.shift
        item = item.find_item(item_key)
        raise RuntimeError.new("Unknown settings group or entry '#{item_key}' in settings path #{[@group.key,key].list_join('.')}") if item.nil?
      end
      item
    end
def find_item ( key ) item = @group key = key . to_s parts = key . split ( / \. / ) until parts . empty? item_key = parts . shift item = item . find_item ( item_key ) raise RuntimeError . new ( "Unknown settings group or entry '#{item_key}' in settings path #{[@group.key,key].list_join('.')}" ) if item . nil? end item end
Finds the item (group or entry) in the hierarchy matching the provided
relative key.
Finds the item ( group or entry ) in the hierarchy matching the provided relative key .
key
<not_specific>