NAME arrayfields.rb URIS http://rubyforge.org/projects/arrayfields/ http://www.codeforpeople.com/lib/ruby/arrayfields/ http://raa.ruby-lang.org/project/arrayfields/ SYNOPSIS require 'arrayfields' fields = 'name', 'age' a = [ 'zaphod', 42 ] a.fields = fields a[ 'name' ] #=> 'zaphod' a[ :name ] #=> 'zaphod' a.indices 'name', 'age' #=> [ 'zaphod', 42 ] DESCRIPTION allow keyword access to array instances. arrayfields works by adding only a few methods to arrays, namely #fields= and fields, but the #fields= method is hooked to extend arrays on a per object basis. in otherwords __only__ those arrays whose fields are set will have auto-magical keyword access bestowed on them - all other arrays remain unaffected. arrays with keyword access require much less memory when compared to hashes/objects and yet still provide fast lookup. LIST OF OVERRIDDEN METHODS Array#[] Array#slice Array#[]= Array#at Array#delete_at Array#fill Array#values_at Array#indices Array#indexes Array#slice! LIST OF HASH-LIKE METHODS Array#each_with_field Array#each_pair Array#each_key Array#each_value Array#fetch Array#has_key? Array#member? Array#key? Array#has_value? Array#value? Array#keys Array#store Array#values Array#to_hash Array#to_h Array#update Array#replace Array#invert LIST OF ADDED Array METHODS Array#fields= Array#fields