Class: Kuby::TrailingHash
- Inherits:
-
Hash
- Object
- Hash
- Kuby::TrailingHash
- Defined in:
- lib/kuby/trailing_hash.rb
Instance Method Summary collapse
Instance Method Details
#each(&block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/kuby/trailing_hash.rb', line 5 def each(&block) return to_enum(__method__) unless block_given? seen_keys = [] keys_before = keys until keys_before.empty? keys_before.each do |k| yield k, self[k] seen_keys << k end keys_before = keys - seen_keys end end |