Class: Hash

Inherits:
Object
  • Object
show all
Defined in:
lib/yandex_uslugi_wrapper/hash.rb

Overview

Evil hack для исправления ошибки с ‘collect! Ошибка возникает при вызове Bank.all, search github.com/rails/rails/issues/2318

Instance Method Summary collapse

Instance Method Details

#collect!(&block) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/yandex_uslugi_wrapper/hash.rb', line 5

def collect!(&block)
  ret = []
  self.each {|key,val|
    if val.kind_of? Array
      val.collect!{|subval|
        block.call subval
      }
      ret = val
    end
  }
  return ret
end