Class: FetchingHash

Inherits:
Fetching show all
Defined in:
lib/fetching.rb

Constant Summary

Constants inherited from Fetching

Fetching::VERSION, Fetching::WHITELIST

Instance Method Summary collapse

Methods inherited from Fetching

#==, from, from_json, #hash

Constructor Details

#initialize(*args) ⇒ FetchingHash

Returns a new instance of FetchingHash.



71
72
73
74
# File 'lib/fetching.rb', line 71

def initialize *args
  super
  make_methods
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(key, *args, &block) ⇒ Object (private)



90
91
92
# File 'lib/fetching.rb', line 90

def method_missing key, *args, &block
  fail NoMethodError, "#{key} not found\nyou have:\n#{@table.inspect}"
end

Instance Method Details

#to_hashObject



76
77
78
# File 'lib/fetching.rb', line 76

def to_hash
  @table.dup
end