Class: Dispersion::Annotation
- Inherits:
-
Object
- Object
- Dispersion::Annotation
- Includes:
- Comparable
- Defined in:
- lib/dispersion/annotation.rb
Instance Attribute Summary collapse
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #comparison_value ⇒ Object
-
#initialize(type, location) ⇒ Annotation
constructor
A new instance of Annotation.
- #to_ary ⇒ Object
Constructor Details
#initialize(type, location) ⇒ Annotation
Returns a new instance of Annotation.
7 8 9 10 |
# File 'lib/dispersion/annotation.rb', line 7 def initialize(type, location) @type = type @location = location end |
Instance Attribute Details
#location ⇒ Object (readonly)
Returns the value of attribute location.
12 13 14 |
# File 'lib/dispersion/annotation.rb', line 12 def location @location end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
12 13 14 |
# File 'lib/dispersion/annotation.rb', line 12 def type @type end |
Instance Method Details
#<=>(other) ⇒ Object
14 15 16 |
# File 'lib/dispersion/annotation.rb', line 14 def <=>(other) comparison_value <=> other.comparison_value end |
#comparison_value ⇒ Object
18 19 20 21 22 23 |
# File 'lib/dispersion/annotation.rb', line 18 def comparison_value [ location, (type == :reset ? 0 : 1) ] end |
#to_ary ⇒ Object
25 26 27 |
# File 'lib/dispersion/annotation.rb', line 25 def to_ary [type, location] end |