Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.ruby > #3388 > unrolled thread
| Started by | Siratinee Sukachai <ploy.sukachai@gmail.com> |
|---|---|
| First post | 2011-04-22 13:52 -0500 |
| Last post | 2011-04-22 14:43 -0500 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.ruby
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
| From | Siratinee Sukachai <ploy.sukachai@gmail.com> |
|---|---|
| Date | 2011-04-22 13:52 -0500 |
| Subject | Can I check the a hash contain another hash in deep check? |
| Message-ID | <8fbd65fb29171a781300613cbda0168f@ruby-forum.com> |
h = {'Member'=>{'number'=>{'name'=>'Name'}}}
Can I check from the key which the value is also hashes?
example:
h['Member'].has_hash_value = true/ false
some kind like this... Can I?
--
Posted via http://www.ruby-forum.com/.
[toc] | [next] | [standalone]
| From | 7stud -- <bbxx789_05ss@yahoo.com> |
|---|---|
| Date | 2011-04-22 14:43 -0500 |
| Message-ID | <758c4aaf187411fc8e2eba4061c112d2@ruby-forum.com> |
| In reply to | #3388 |
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/.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.ruby
csiph-web