Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #3390

Re: Can I check the a hash contain another hash in deep check?

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!usenet-fr.net!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!talisker.lacave.net!lacave.net!not-for-mail
From 7stud -- <bbxx789_05ss@yahoo.com>
Newsgroups comp.lang.ruby
Subject Re: Can I check the a hash contain another hash in deep check?
Date Fri, 22 Apr 2011 14:43:24 -0500
Organization Service de news de lacave.net
Lines 23
Message-ID <758c4aaf187411fc8e2eba4061c112d2@ruby-forum.com> (permalink)
References <8fbd65fb29171a781300613cbda0168f@ruby-forum.com>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1303501429 36141 65.111.164.187 (22 Apr 2011 19:43:49 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Fri, 22 Apr 2011 19:43:49 +0000 (UTC)
In-Reply-To <8fbd65fb29171a781300613cbda0168f@ruby-forum.com>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 382078
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <758c4aaf187411fc8e2eba4061c112d2@ruby-forum.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:3390

Show key headers only | View raw


Siratinee Sukachai wrote in post #994555:
> h = {'Member'=>{'number'=>{'name'=>'Name'}}}
>
> Can I check from the key which the value is also hashes?
> example:
>
> has_hash_value(h['Member']) = true/ false
>
> some kind like this... Can I?


h = {'Member'=>{'number'=>{'name'=>'Name'}}}

if h['Member'].instance_of?(Hash)
  puts 'yes'
end

--output:--
yes

-- 
Posted via http://www.ruby-forum.com/.

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Can I check the a hash contain another hash in deep check? Siratinee Sukachai <ploy.sukachai@gmail.com> - 2011-04-22 13:52 -0500
  Re: Can I check the a hash contain another hash in deep check? 7stud -- <bbxx789_05ss@yahoo.com> - 2011-04-22 14:43 -0500

csiph-web