Class: ProbeDockProbe::Annotation
- Inherits:
-
Object
- Object
- ProbeDockProbe::Annotation
- Defined in:
- lib/probe_dock_ruby/annotation.rb
Constant Summary collapse
- BASE_REGEXP_STRING =
'@probedock\(([^\(\)]*)\)'
- ANNOTATION_REGEXP =
/#{BASE_REGEXP_STRING}/
- STRIP_ANNOTATION_REGEXP =
/\s*#{BASE_REGEXP_STRING}/
Instance Attribute Summary collapse
-
#active ⇒ Object
readonly
Returns the value of attribute active.
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#tickets ⇒ Object
readonly
Returns the value of attribute tickets.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(str) ⇒ Annotation
constructor
A new instance of Annotation.
- #merge!(annotation) ⇒ Object
Constructor Details
#initialize(str) ⇒ Annotation
Returns a new instance of Annotation.
9 10 11 |
# File 'lib/probe_dock_ruby/annotation.rb', line 9 def initialize(str) parse(str) end |
Instance Attribute Details
#active ⇒ Object (readonly)
Returns the value of attribute active.
7 8 9 |
# File 'lib/probe_dock_ruby/annotation.rb', line 7 def active @active end |
#category ⇒ Object (readonly)
Returns the value of attribute category.
7 8 9 |
# File 'lib/probe_dock_ruby/annotation.rb', line 7 def category @category end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
7 8 9 |
# File 'lib/probe_dock_ruby/annotation.rb', line 7 def key @key end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
7 8 9 |
# File 'lib/probe_dock_ruby/annotation.rb', line 7 def @tags end |
#tickets ⇒ Object (readonly)
Returns the value of attribute tickets.
7 8 9 |
# File 'lib/probe_dock_ruby/annotation.rb', line 7 def tickets @tickets end |
Class Method Details
.strip_annotations(test_name) ⇒ Object
22 23 24 |
# File 'lib/probe_dock_ruby/annotation.rb', line 22 def self.strip_annotations(test_name) test_name.gsub(STRIP_ANNOTATION_REGEXP, '') end |
Instance Method Details
#merge!(annotation) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/probe_dock_ruby/annotation.rb', line 13 def merge!(annotation) @key = annotation.key if annotation.key @category = annotation.category if annotation.category @active = annotation.active unless annotation.active.nil? @tags = (@tags + annotation.).compact.collect(&:to_s).uniq @tickets = (@tickets + annotation.tickets).compact.collect(&:to_s).uniq self end |