Class: RBS::AST::Declarations::Class::Super

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs/ast/declarations.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, args:, location:) ⇒ Super

Returns a new instance of Super.



141
142
143
144
145
# File 'lib/rbs/ast/declarations.rb', line 141

def initialize(name:, args:, location:)
  @name = name
  @args = args
  @location = location
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



138
139
140
# File 'lib/rbs/ast/declarations.rb', line 138

def args
  @args
end

#locationObject (readonly)

Returns the value of attribute location.



139
140
141
# File 'lib/rbs/ast/declarations.rb', line 139

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



137
138
139
# File 'lib/rbs/ast/declarations.rb', line 137

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



147
148
149
# File 'lib/rbs/ast/declarations.rb', line 147

def ==(other)
  other.is_a?(Super) && other.name == name && other.args == args
end

#hashObject



153
154
155
# File 'lib/rbs/ast/declarations.rb', line 153

def hash
  self.class.hash ^ name.hash ^ args.hash
end

#to_json(*a) ⇒ Object



157
158
159
160
161
162
163
# File 'lib/rbs/ast/declarations.rb', line 157

def to_json(*a)
  {
    name: name,
    args: args,
    location: location
  }.to_json(*a)
end