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: [], keywords: [], output: Output.new, on_git_error: nil) ⇒ 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: [], keywords: [], output: Output.new, on_git_error: nil) ⇒ self
Generates an instance of files from the provided arguments
31 32 33 34 35 36 |
# File 'lib/reviewer/arguments/files.rb', line 31 def initialize(provided: [], keywords: [], output: Output.new, on_git_error: nil) @provided = Array(provided) @keywords = Array(keywords) @output = output @on_git_error = on_git_error end |
Instance Attribute Details
#keywords ⇒ Object (readonly)
Returns the value of attribute keywords.
10 11 12 |
# File 'lib/reviewer/arguments/files.rb', line 10 def keywords @keywords end |
#provided ⇒ Object (readonly) Also known as: raw
Returns the value of attribute provided.
10 11 12 |
# File 'lib/reviewer/arguments/files.rb', line 10 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
41 |
# File 'lib/reviewer/arguments/files.rb', line 41 def to_a = file_list |
#to_h ⇒ Hash<Symbol, Array<String>> Also known as: inspect
Summary of the state of the file arguments
51 52 53 54 55 56 |
# File 'lib/reviewer/arguments/files.rb', line 51 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
46 |
# File 'lib/reviewer/arguments/files.rb', line 46 def to_s = to_a.join(',') |