Class: MinispecMetadata::Tag
- Inherits:
-
Object
- Object
- MinispecMetadata::Tag
- Defined in:
- lib/minispec-metadata/tags.rb
Instance Method Summary collapse
- #exclusive? ⇒ Boolean
- #inclusive? ⇒ Boolean
-
#initialize(tag_string) ⇒ Tag
constructor
A new instance of Tag.
- #key ⇒ Object
- #value ⇒ Object
- #value? ⇒ Boolean
Constructor Details
#initialize(tag_string) ⇒ Tag
Returns a new instance of Tag.
77 78 79 |
# File 'lib/minispec-metadata/tags.rb', line 77 def initialize(tag_string) @tag_string = tag_string end |
Instance Method Details
#exclusive? ⇒ Boolean
81 82 83 |
# File 'lib/minispec-metadata/tags.rb', line 81 def exclusive? @tag_string.start_with? '~' end |
#inclusive? ⇒ Boolean
85 86 87 |
# File 'lib/minispec-metadata/tags.rb', line 85 def inclusive? !exclusive? end |
#key ⇒ Object
89 90 91 |
# File 'lib/minispec-metadata/tags.rb', line 89 def key @key ||= @tag_string[/\w+/] end |
#value ⇒ Object
93 94 95 |
# File 'lib/minispec-metadata/tags.rb', line 93 def value @value ||= @tag_string.split(':').last if value? end |
#value? ⇒ Boolean
97 98 99 |
# File 'lib/minispec-metadata/tags.rb', line 97 def value? !!@tag_string[/:/] end |