Sha256: 49e060626b12c3e2e7f61297c390aaea3e49d7bbb5c7bcb86a4a4b96415ede3f
Contents?: true
Size: 461 Bytes
Versions: 29
Compression:
Stored size: 461 Bytes
Contents
module ActiveRestClient class LazyLoader def initialize(request, params = nil) @request = request @params = params @result = nil end def method_missing(name, *args) if @result.nil? @result = @request.call(@params) end @result.send(name, *args) end def respond_to?(name) if @result.nil? @result = @request.call(@params) end @result.respond_to?(name) end end end
Version data entries
29 entries across 29 versions & 1 rubygems