class GH::LazyLoader
Public: …
Public Instance Methods
modify_hash(hash, loaded = false)
click to toggle source
Calls superclass method
# File lib/gh/lazy_loader.rb, line 9 def modify_hash(hash, loaded = false) hash = super(hash) link = hash['_links']['self'] unless loaded or hash['_links'].nil? setup_lazy_loading(hash, link['href']) if link hash rescue Exception => error raise Error.new(error, hash) end
Private Instance Methods
lazy_load(hash, key, link)
click to toggle source
# File lib/gh/lazy_loader.rb, line 20 def lazy_load(hash, key, link) modify_hash(backend[link].data, true) rescue Exception => error raise Error.new(error, hash) end