Sha256: d89be532c295682fd0703a02a5fca2d7ed2472fda60ee9e0465d8372aa2134ff
Contents?: true
Size: 568 Bytes
Versions: 16
Compression:
Stored size: 568 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 record = _data._root._record_class data = record.request(url: _data.href, method: :get) _data.merge_raw!(data) self._loaded = true self end end
Version data entries
16 entries across 16 versions & 1 rubygems