Module: Qig::Qiggable
- Defined in:
- lib/qig/qiggable.rb
Overview
mix-in to add a .qig method to any class.
NOTE: Target class should support #[], #map, and either #flat_map or #values for full qig functionality
#[]: used for stepping in unit context#map: used for stepping in collection context#flat_mapor#values: used for unboxing in collection context
Instance Method Summary collapse
-
#lazy ⇒ Object
see Enumerable#lazy.
-
#qig(*path) ⇒ Object+
The value(s) of
selflocated atpath.
Instance Method Details
#lazy ⇒ Object
see Enumerable#lazy
This version extends the underlying lazy enumerable with Qig::Qiggable
20 21 22 |
# File 'lib/qig/qiggable.rb', line 20 def lazy super.extend(Qig::Qiggable) end |
#qig(*path) ⇒ Object+
Returns the value(s) of self located at path.
13 14 15 |
# File 'lib/qig/qiggable.rb', line 13 def qig(*path) Qig.qig(self, *path) end |