Class: Watnow::Annotation
- Inherits:
-
Object
- Object
- Watnow::Annotation
- Defined in:
- lib/watnow/annotation/annotation.rb
Overview
An Annotation is basically a group of AnnotationLine
Constant Summary collapse
- @@id =
0
- @@instances =
[]
Instance Attribute Summary collapse
-
#file ⇒ Object
Returns the value of attribute file.
-
#id ⇒ Object
Returns the value of attribute id.
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#priority ⇒ Object
Returns the value of attribute priority.
Class Method Summary collapse
-
.all ⇒ Object
An ORM-like method that returns all Annotation instances.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Annotation
constructor
A new instance of Annotation.
Constructor Details
#initialize(opts) ⇒ Annotation
Returns a new instance of Annotation.
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/watnow/annotation/annotation.rb', line 15 def initialize(opts) @priority = 0 @file = opts[:file] @lines = set_lines(opts[:lines]) # Auto increment instances id # Push instance into a class array @id = @@id += 1 @@instances << self end |
Instance Attribute Details
#file ⇒ Object
Returns the value of attribute file.
8 9 10 |
# File 'lib/watnow/annotation/annotation.rb', line 8 def file @file end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/watnow/annotation/annotation.rb', line 8 def id @id end |
#lines ⇒ Object
Returns the value of attribute lines.
8 9 10 |
# File 'lib/watnow/annotation/annotation.rb', line 8 def lines @lines end |
#priority ⇒ Object
Returns the value of attribute priority.
8 9 10 |
# File 'lib/watnow/annotation/annotation.rb', line 8 def priority @priority end |
Class Method Details
.all ⇒ Object
An ORM-like method that returns all Annotation instances
11 12 13 |
# File 'lib/watnow/annotation/annotation.rb', line 11 def self.all @@instances end |