Class: Wikiwhat::Results
- Inherits:
-
Object
- Object
- Wikiwhat::Results
- Defined in:
- lib/wikiwhat/parse.rb
Instance Method Summary collapse
-
#initialize ⇒ Results
constructor
A new instance of Results.
- #pull_from_hash(hash, key) ⇒ Object
Constructor Details
#initialize ⇒ Results
Returns a new instance of Results.
6 7 8 |
# File 'lib/wikiwhat/parse.rb', line 6 def initialize @result = nil end |
Instance Method Details
#pull_from_hash(hash, key) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/wikiwhat/parse.rb', line 10 def pull_from_hash(hash, key) @hash = hash @key = key if @hash.include?(@key) @result = @hash[@key] else @hash.each_pair do |k, v| if v.class == Hash pull_from_hash(v, @key) end end end @result end |