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 ⇒ Object
(also: #raw)
Returns the value of attribute provided.
Instance Method Summary collapse
-
#initialize(provided: Reviewer.arguments.tags.raw, keywords: Reviewer.arguments.keywords.for_tags) ⇒ self
constructor
Generates an instace 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: Reviewer.arguments.tags.raw, keywords: Reviewer.arguments.keywords.for_tags) ⇒ self
Generates an instace of parsed tags from the provided arguments by merging tag arguments
that were provided via either flags or keywords
26 27 28 29 |
# File 'lib/reviewer/arguments/tags.rb', line 26 def initialize(provided: Reviewer.arguments..raw, keywords: Reviewer.arguments.keywords.) @provided = Array(provided) @keywords = Array(keywords) end |
Instance Attribute Details
#keywords ⇒ Object
Returns the value of attribute keywords.
7 8 9 |
# File 'lib/reviewer/arguments/tags.rb', line 7 def keywords @keywords end |
#provided ⇒ Object Also known as: raw
Returns the value of attribute provided.
7 8 9 |
# File 'lib/reviewer/arguments/tags.rb', line 7 def provided @provided end |
Instance Method Details
#to_a ⇒ Array<String>
Provides the full list of tags values derived from the command-line arguments
34 35 36 |
# File 'lib/reviewer/arguments/tags.rb', line 34 def to_a tag_list end |
#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
41 42 43 |
# File 'lib/reviewer/arguments/tags.rb', line 41 def to_s to_a.join(',') end |