From: Matthew Kerwin Date: 2013-07-19T23:34:36+09:00 Subject: Re: need to help to get data from bellow syntax Something like this, maybe: bellow_syntax = [{:name=>"value1"}, {:name=>"Value2"}] puts bellow_syntax.map{ |hash| name = hash[:name] name =~ /^V(alu)e(2)$/ ? "v#$1#$2" : name } ... but that's mean. [...] means an array, so you can use .each to iterate over its members. {...} means a hash, so you can use foo[bar] to access its members :foo means a symbol, which is just a ruby datatype ary = [{:name=>"value1"}, {:name=>"value2"}] ary.each do |hsh| # hsh == {:name=>"valueX"} # hsh[:name] == "valueX" puts hsh[:name] end On 19 July 2013 23:50, Fosiul Alam wrote: > Hi > > I need a help to read data from bellow syntax > > [{:name=>"value1"}, {:name=>"Value2"}] > > so its wiill be > > value1 > valu2 > > but dont understand how to get that. > any help and explanation will be really helpful > Thanks > > -- > Posted via http://www.ruby-forum.com/. > -- Matthew Kerwin, B.Sc (CompSci) (Hons) http://matthew.kerwin.net.au/