Class: Reviewer::Arguments::Tags
- Inherits:
-
Object
- Object
- Reviewer::Arguments::Tags
- Defined in:
- lib/reviewer/arguments/tags.rb
Overview
Handles the logic of translating tag arguments
Instance Attribute Summary collapse
-
#keywords ⇒ Object
Returns the value of attribute keywords.
-
#provided ⇒ Array<String>
(also: #raw)
Tags explicitly provided via -t or –tags flag.
Instance Method Summary collapse
-
#initialize(provided: [], keywords: []) ⇒ self
constructor
Generates an instance of parsed tags from the provided arguments by merging tag arguments that were provided via either flags or keywords.
-
#to_a ⇒ Array<String>
Provides the full list of tags values derived from the command-line arguments.
-
#to_h ⇒ Hash
(also: #inspect)
Summary of the state of the tag arguments.
-
#to_s ⇒ String
Provides the full list of tag values derived from the command-line arguments.
Constructor Details
#initialize(provided: [], keywords: []) ⇒ self
Generates an instance of parsed tags from the provided arguments by merging tag arguments
that were provided via either flags or keywords
30 31 32 33 |
# File 'lib/reviewer/arguments/tags.rb', line 30 def initialize(provided: [], keywords: []) @provided = Array(provided) @keywords = Array(keywords) end |
Instance Attribute Details
#keywords ⇒ Object
Returns the value of attribute keywords.
11 |
# File 'lib/reviewer/arguments/tags.rb', line 11 attr_reader :provided, :keywords |
#provided ⇒ Array<String> Also known as: raw
Returns tags explicitly provided via -t or –tags flag.
11 12 13 |
# File 'lib/reviewer/arguments/tags.rb', line 11 def provided @provided end |
Instance Method Details
#to_a ⇒ Array<String>
Provides the full list of tags values derived from the command-line arguments
38 |
# File 'lib/reviewer/arguments/tags.rb', line 38 def to_a = tag_list |
#to_h ⇒ Hash Also known as: inspect
Summary of the state of the tag arguments
48 49 50 51 52 53 |
# File 'lib/reviewer/arguments/tags.rb', line 48 def to_h { provided: provided.sort, from_keywords: keywords.sort } end |
#to_s ⇒ String
Provides the full list of tag values derived from the command-line arguments
43 |
# File 'lib/reviewer/arguments/tags.rb', line 43 def to_s = to_a.join(',') |