Class: Steep::AST::Annotation::Dynamic

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

Defined Under Namespace

Classes: Name

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(names:, location: nil) ⇒ Dynamic

Returns a new instance of Dynamic.



118
119
120
121
# File 'lib/steep/ast/annotation.rb', line 118

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location.



115
116
117
# File 'lib/steep/ast/annotation.rb', line 115

def location
  @location
end

#namesObject (readonly)

Returns the value of attribute names.



116
117
118
# File 'lib/steep/ast/annotation.rb', line 116

def names
  @names
end

Instance Method Details

#==(other) ⇒ Object



123
124
125
126
127
# File 'lib/steep/ast/annotation.rb', line 123

def ==(other)
  other.is_a?(Dynamic) &&
    other.names == names &&
    (!other.location || location || other.location == location)
end