Class: ROM::Files::Dataset
- Inherits:
-
Memory::Dataset
- Object
- Memory::Dataset
- ROM::Files::Dataset
- Extended by:
- Forwardable
- Defined in:
- lib/rom/files/dataset.rb,
lib/rom/files/dataset/paths.rb,
lib/rom/files/dataset/sorting.rb,
lib/rom/files/dataset/filtering.rb,
lib/rom/files/dataset/mime_type.rb
Defined Under Namespace
Modules: Filtering, MimeType, Paths, Sorting
Instance Attribute Summary collapse
- #connection ⇒ Connection readonly
- #path ⇒ Connection readonly
Attributes included from Sorting
Attributes included from Paths
Attributes included from MimeType
Attributes included from Filtering
#exclude_patterns, #include_patterns, #inside_paths, #search_recursive
Instance Method Summary collapse
- #at(path) ⇒ Object
- #dig(path) ⇒ Object
- #initialize(mime_type: nil, inside_paths: ['.'], include_patterns: ['*'], exclude_patterns: [], sorting: nil) ⇒ Object constructor
-
#join(*args) ⇒ Dataset
Join with other datasets.
-
#project(*names) ⇒ Dataset
Project a dataset.
-
#restrict(criteria = nil) ⇒ Dataset
Restrict a dataset.
- #up(level = 1) ⇒ Object
Methods included from Sorting
Methods included from Paths
#count, #data, #each, included, #paths, #pluck
Methods included from MimeType
Methods included from Filtering
included, #inside, #inside_append, #not_recursive, #recursive, #recursive?, #reject, #reject_append, #search_patterns, #select, #select_append
Constructor Details
#initialize(mime_type: nil, inside_paths: ['.'], include_patterns: ['*'], exclude_patterns: [], sorting: nil) ⇒ Object
|
# File 'lib/rom/files/dataset.rb', line 28
|
Instance Attribute Details
#connection ⇒ Connection (readonly)
40 |
# File 'lib/rom/files/dataset.rb', line 40 option :connection, default: proc { Connection.new } |
#path ⇒ Connection (readonly)
44 |
# File 'lib/rom/files/dataset.rb', line 44 option :path, Types::Coercible::Pathname, default: proc { connection.path } |
Instance Method Details
#at(path) ⇒ Object
46 47 48 |
# File 'lib/rom/files/dataset.rb', line 46 def at(path) with(path: Pathname(path)) end |
#dig(path) ⇒ Object
50 51 52 |
# File 'lib/rom/files/dataset.rb', line 50 def dig(path) with(path: self.path.join(path)) end |
#up(level = 1) ⇒ Object
54 55 56 57 58 |
# File 'lib/rom/files/dataset.rb', line 54 def up(level = 1) path = self.path level.times { path = path.dirname } with(path: path) end |