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.



59
60
61
62
63
# File 'lib/rbs/ast/declarations.rb', line 59

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



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

def args
  @args
end

#locationObject (readonly)

Returns the value of attribute location.



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

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

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



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

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

#hashObject



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

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

#to_json(state = _ = nil) ⇒ Object



75
76
77
78
79
80
81
# File 'lib/rbs/ast/declarations.rb', line 75

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