Class ExtStrAccessor
In: lib/svengali/ext_string.rb
Parent: Object

Methods

[]   new  

Public Class methods

[Source]

# File lib/svengali/ext_string.rb, line 36
  def initialize(file_name_str,first_level_name)
    @contents_hash = YAML.load_file( file_name_str )
    @first_level = first_level_name
  end

Public Instance methods

[Source]

# File lib/svengali/ext_string.rb, line 41
  def [](key)
    val = @contents_hash[@first_level][key]
    if val
      return val
    else
      default_val = @contents_hash["default"][val]
      if default_val
        return default_val
      else
        debug_p "key( #{key.to_s} ) is not found on even default hash!"
      end
    end
  end

[Validate]