Class: Steep::AST::Annotation::Named

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

Direct Known Subclasses

ConstType, IvarType, MethodType, VarType

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, type:, location: nil) ⇒ Named

Returns a new instance of Named.



9
10
11
12
13
# File 'lib/steep/ast/annotation.rb', line 9

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



7
8
9
# File 'lib/steep/ast/annotation.rb', line 7

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
# File 'lib/steep/ast/annotation.rb', line 15

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