Class: Steep::AST::Annotation::Typed

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, location: nil) ⇒ Typed

Returns a new instance of Typed.



27
28
29
30
# File 'lib/steep/ast/annotation.rb', line 27

def initialize(type:, location: nil)
  @type = type
  @location = location
end

Instance Attribute Details

#annotationObject (readonly)

Returns the value of attribute annotation.



24
25
26
# File 'lib/steep/ast/annotation.rb', line 24

def annotation
  @annotation
end

#locationObject (readonly)

Returns the value of attribute location.



25
26
27
# File 'lib/steep/ast/annotation.rb', line 25

def location
  @location
end

#typeObject (readonly)

Returns the value of attribute type.



23
24
25
# File 'lib/steep/ast/annotation.rb', line 23

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



32
33
34
35
# File 'lib/steep/ast/annotation.rb', line 32

def ==(other)
  other.is_a?(self.class) &&
    other.type == type
end