Sha256: d0992733834b7c702037cbea2bc60d69bbcad2f5c2432a947846f33f1dd36cf3
Contents?: true
Size: 554 Bytes
Versions: 27
Compression:
Stored size: 554 Bytes
Contents
require 'gh' module GH # Public: ... class LazyLoader < Wrapper wraps GH::Normalizer double_dispatch def modify_hash(hash, loaded = false) hash = super(hash) link = hash['_links'].try(:[], 'self') unless loaded setup_lazy_loading(hash, link['href']) if link hash rescue Exception => error raise Error.new(error, hash) end private def lazy_load(hash, key, link) modify_hash(backend[link].data, true) rescue Exception => error raise Error.new(error, hash) end end end
Version data entries
27 entries across 27 versions & 1 rubygems