class RBS::AST::Declarations::Constant
Attributes
Public Class Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/ast/declarations.rb, line 354 def initialize(name:, type:, location:, comment:, annotations: []) @name = name @type = type @location = location @comment = comment @annotations = annotations || [] end
Public Instance Methods
Source
# File bundled-src/rbs-3.10.0/lib/rbs/ast/declarations.rb, line 362 def ==(other) other.is_a?(Constant) && other.name == name && other.type == type end
Also aliased as: eql?
Source
# File bundled-src/rbs-3.10.0/lib/rbs/ast/declarations.rb, line 370 def hash self.class.hash ^ name.hash ^ type.hash end
Source
# File bundled-src/rbs-3.10.0/lib/rbs/ast/declarations.rb, line 374 def to_json(state = _ = nil) { declaration: :constant, name: name, type: type, location: location, comment: comment }.to_json(state) end