Class: Array
Overview
:nodoc:
Instance Method Summary collapse
- #__index(key) ⇒ Object
- #compare_includes?(haystack, prefix = []) ⇒ Boolean
- #has_key?(index) ⇒ Boolean
Instance Method Details
#__index(key) ⇒ Object
6 7 8 |
# File 'lib/web/assertinclude.rb', line 6 def __index(key) self[key] end |
#compare_includes?(haystack, prefix = []) ⇒ Boolean
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/web/assertinclude.rb', line 10 def compare_includes? haystack, prefix=[] = "" each_with_index{ |v, k| fullname = prefix.clone if fullname.length > 0 fullname[fullname.length-1] = "#{fullname.last}[#{k}]" else fullname[0] = "<Array>[#{k}]" end fullname_str = fullname.join(".") += do_thing(haystack, k, v, fullname, fullname_str) } end |
#has_key?(index) ⇒ Boolean
2 3 4 |
# File 'lib/web/assertinclude.rb', line 2 def has_key?(index) index >= 0 && index < length end |