Class: Reviewer::Arguments::Files
- Inherits:
-
Object
- Object
- Reviewer::Arguments::Files
- Defined in:
- lib/reviewer/arguments/files.rb
Overview
Generates a Ruby-friendly list (Array) of files to run the command against from the provided command line arguments
Instance Attribute Summary collapse
-
#keywords ⇒ Object
readonly
Returns the value of attribute keywords.
-
#provided ⇒ Object
(also: #raw)
readonly
Returns the value of attribute provided.
Instance Method Summary collapse
-
#initialize(provided: Reviewer.arguments.files.raw, keywords: Reviewer.arguments.keywords) ⇒ self
constructor
Generates an instance of files from the provided arguments.
-
#to_a ⇒ Array<String>
Provides the full list of file/path values derived from the command-line arguments.
-
#to_h ⇒ Hash<Symbol, Array<String>>
(also: #inspect)
Summary of the state of the file arguments.
-
#to_s ⇒ String
Provides the full list of file/path values derived from the command-line arguments.
Constructor Details
#initialize(provided: Reviewer.arguments.files.raw, keywords: Reviewer.arguments.keywords) ⇒ self
Generates an instance of files from the provided arguments
26 27 28 29 |
# File 'lib/reviewer/arguments/files.rb', line 26 def initialize(provided: Reviewer.arguments.files.raw, keywords: Reviewer.arguments.keywords) @provided = Array(provided) @keywords = Array(keywords) end |
Instance Attribute Details
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
8 9 10 |
# File 'lib/reviewer/arguments/files.rb', line 8 def keywords @keywords end |
#provided ⇒ Object (readonly) Also known as: raw
Returns the value of attribute provided.
8 9 10 |
# File 'lib/reviewer/arguments/files.rb', line 8 def provided @provided end |
Instance Method Details
#to_a ⇒ Array<String>
Provides the full list of file/path values derived from the command-line arguments
34 35 36 |
# File 'lib/reviewer/arguments/files.rb', line 34 def to_a file_list end |
#to_h ⇒ Hash<Symbol, Array<String>> Also known as: inspect
Summary of the state of the file arguments
48 49 50 51 52 53 |
# File 'lib/reviewer/arguments/files.rb', line 48 def to_h { provided: provided.sort, from_keywords: from_keywords } end |
#to_s ⇒ String
Provides the full list of file/path values derived from the command-line arguments
41 42 43 |
# File 'lib/reviewer/arguments/files.rb', line 41 def to_s to_a.join(',') end |