Class: Hekenga::IdIterator
- Inherits:
-
BaseIterator
- Object
- BaseIterator
- Hekenga::IdIterator
- Defined in:
- lib/hekenga/id_iterator.rb
Constant Summary collapse
- DEFAULT_ID =
"_id".freeze
Constants inherited from BaseIterator
Instance Attribute Summary collapse
-
#id_property ⇒ Object
readonly
Returns the value of attribute id_property.
Attributes inherited from BaseIterator
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(id_property: DEFAULT_ID, **kwargs) ⇒ IdIterator
constructor
A new instance of IdIterator.
Constructor Details
#initialize(id_property: DEFAULT_ID, **kwargs) ⇒ IdIterator
Returns a new instance of IdIterator.
8 9 10 11 |
# File 'lib/hekenga/id_iterator.rb', line 8 def initialize(id_property: DEFAULT_ID, **kwargs) super(**kwargs) @id_property = id_property end |
Instance Attribute Details
#id_property ⇒ Object (readonly)
Returns the value of attribute id_property.
6 7 8 |
# File 'lib/hekenga/id_iterator.rb', line 6 def id_property @id_property end |
Instance Method Details
#each ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/hekenga/id_iterator.rb', line 13 def each with_view do |view| view.each do |doc| yield doc[id_property] end end end |