Class: Steep::Source::LocatedAnnotation

Inherits:
Object
  • Object
show all
Defined in:
lib/steep/source.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(line:, source:, annotation:) ⇒ LocatedAnnotation

Returns a new instance of LocatedAnnotation.



8
9
10
11
12
# File 'lib/steep/source.rb', line 8

def initialize(line:, source:, annotation:)
  @line = line
  @source = source
  @annotation = annotation
end

Instance Attribute Details

#annotationObject (readonly)

Returns the value of attribute annotation.



5
6
7
# File 'lib/steep/source.rb', line 5

def annotation
  @annotation
end

#lineObject (readonly)

Returns the value of attribute line.



4
5
6
# File 'lib/steep/source.rb', line 4

def line
  @line
end

#sourceObject (readonly)

Returns the value of attribute source.



6
7
8
# File 'lib/steep/source.rb', line 6

def source
  @source
end

Instance Method Details

#==(other) ⇒ Object



14
15
16
17
18
# File 'lib/steep/source.rb', line 14

def ==(other)
  other.is_a?(LocatedAnnotation) &&
    other.line == line &&
    other.annotation == annotation
end