also it is possible to use method fetch - http://www.ruby-doc.org/core-2.0.0/Array.html#method-i-fetch and http://www.ruby-doc.org/core-2.0.0/Hash.html#method-i-fetch