Class: RBS::AST::Declarations::Class::Super
- Inherits:
-
Object
- Object
- RBS::AST::Declarations::Class::Super
- Defined in:
- lib/rbs/ast/declarations.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#location ⇒ Object
readonly
Returns the value of attribute location.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(name:, args:, location:) ⇒ Super
constructor
A new instance of Super.
- #to_json(state = _ = nil) ⇒ Object
Constructor Details
#initialize(name:, args:, location:) ⇒ Super
Returns a new instance of Super.
156 157 158 159 160 |
# File 'lib/rbs/ast/declarations.rb', line 156 def initialize(name:, args:, location:) @name = name @args = args @location = location end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
153 154 155 |
# File 'lib/rbs/ast/declarations.rb', line 153 def args @args end |
#location ⇒ Object (readonly)
Returns the value of attribute location.
154 155 156 |
# File 'lib/rbs/ast/declarations.rb', line 154 def location @location end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
152 153 154 |
# File 'lib/rbs/ast/declarations.rb', line 152 def name @name end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
162 163 164 |
# File 'lib/rbs/ast/declarations.rb', line 162 def ==(other) other.is_a?(Super) && other.name == name && other.args == args end |
#hash ⇒ Object
168 169 170 |
# File 'lib/rbs/ast/declarations.rb', line 168 def hash self.class.hash ^ name.hash ^ args.hash end |
#to_json(state = _ = nil) ⇒ Object
172 173 174 175 176 177 178 |
# File 'lib/rbs/ast/declarations.rb', line 172 def to_json(state = _ = nil) { name: name, args: args, location: location }.to_json(state) end |