Sha256: cfb1b19eefdd2240e8c39466746f4e820b0f3e8768e915c092803a8f3eef668e
Contents?: true
Size: 534 Bytes
Versions: 33
Compression:
Stored size: 534 Bytes
Contents
# Proxy makes different kind of data accessible # If href is present it also alows loading/reloading class LHS::Proxy # prevent clashing with attributes of underlying data attr_accessor :_data, :_loaded def initialize(data) self._data = data self._loaded = false end def load! return self if _loaded reload! end def reload! fail 'No href found' unless _data.href data = _data.class.request(url: _data.href, method: :get) _data.merge_raw!(data) self._loaded = true self end end
Version data entries
33 entries across 33 versions & 1 rubygems