Class: Toys::Completion::FileSystem
- Defined in:
- core-docs/toys/completion.rb
Overview
Defined in the toys-core gem
A Completion that returns candidates from the local file system.
Instance Attribute Summary collapse
-
#cwd ⇒ String
readonly
Path to the starting directory.
-
#include_directories ⇒ Boolean
readonly
Whether directories are included in the completion candidates.
-
#include_files ⇒ Boolean
readonly
Whether files are included in the completion candidates.
-
#prefix_constraint ⇒ String, Regexp
readonly
Constraint on the fragment prefix.
Instance Method Summary collapse
-
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
-
#initialize(cwd: nil, omit_files: false, omit_directories: false, prefix_constraint: "") ⇒ FileSystem
constructor
Create a completion that gets candidates from names in the local file system.
Constructor Details
#initialize(cwd: nil, omit_files: false, omit_directories: false, prefix_constraint: "") ⇒ FileSystem
Create a completion that gets candidates from names in the local file system.
204 205 206 |
# File 'core-docs/toys/completion.rb', line 204 def initialize(cwd: nil, omit_files: false, omit_directories: false, prefix_constraint: "") # Source available in the toys-core gem end |
Instance Attribute Details
#cwd ⇒ String (readonly)
Path to the starting directory.
230 231 232 |
# File 'core-docs/toys/completion.rb', line 230 def cwd @cwd end |
#include_directories ⇒ Boolean (readonly)
Whether directories are included in the completion candidates.
218 219 220 |
# File 'core-docs/toys/completion.rb', line 218 def include_directories @include_directories end |
#include_files ⇒ Boolean (readonly)
Whether files are included in the completion candidates.
212 213 214 |
# File 'core-docs/toys/completion.rb', line 212 def include_files @include_files end |
#prefix_constraint ⇒ String, Regexp (readonly)
Constraint on the fragment prefix.
224 225 226 |
# File 'core-docs/toys/completion.rb', line 224 def prefix_constraint @prefix_constraint end |
Instance Method Details
#call(context) ⇒ Array<Toys::Completion::Candidate>
Returns candidates for the current completion.
239 240 241 |
# File 'core-docs/toys/completion.rb', line 239 def call(context) # Source available in the toys-core gem end |