123456789_123456789_123456789_123456789_123456789_

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

Relationships & Source Files
Inherits: Object
Defined in: lib/rbs/ast/declarations.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.new(name:, args:, location:) ⇒ Super

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 61

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

Instance Attribute Details

#args (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 58

attr_reader :args

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 59

attr_reader :location

#name (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 57

attr_reader :name

Instance Method Details

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

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 67

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

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 71

alias eql? ==

#hash

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 73

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

#to_json(state = _ = nil)

[ GitHub ]

  
# File 'lib/rbs/ast/declarations.rb', line 77

def to_json(state = _ = nil)
  {
    name: name,
    args: args,
    location: location
  }.to_json(state)
end