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

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

Instance Attribute Summary collapse

Attributes included from Located

#location

Instance Method Summary collapse

Methods included from Located

#line

Constructor Details

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

Returns a new instance of Typed.



36
37
38
39
# File 'lib/steep/ast/annotation.rb', line 36

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

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



41
42
43
44
# File 'lib/steep/ast/annotation.rb', line 41

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