Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. def respond_to?(method, include_private = false)
  2. load_data if @last_updated.nil?
  3. super || @data.respond_to?(method, include_private)
  4. end
  5.  
  6. def method_missing(sym, *args, &block)
  7. load_data if @last_updated.nil?
  8. return super unless @data.respond_to? sym
  9. instance_eval "def #{sym}(*args, &block) @data.#{sym}(*args, &block) end"
  10. send(sym, *args, &block)
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement