module NewspaperWorks::Ingest::PathEnumeration
Provides enumeration of path keys to object values, where:
- Consuming class: - Defines a `paths` method returning array of paths. - Defines an `info` method that returns an object for a path. - Also mixes in Enumerable
Public Instance Methods
_info(path)
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 15 def _info(path) info(path) end
Also aliased as: []
_paths()
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 11 def _paths paths end
Also aliased as: keys
each() { |path, info(path)| ... }
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 19 def each return enum_for(:each) unless block_given? paths.each do |path| yield [path, info(path)] end end
Also aliased as: each_pair
each_key() { |path| ... }
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 26 def each_key enum_for(:each_key) unless block_given? paths.each { |path| yield path } end
each_value() { |info(path)| ... }
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 31 def each_value return enum_for(:each_value) unless block_given? paths.each do |path| yield info(path) end end
entries()
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 42 def entries each.to_a end
values()
click to toggle source
# File lib/newspaper_works/ingest/path_enumeration.rb, line 38 def values each_value.to_a end