class RBS::AST::Declarations::TypeAlias
Attributes
annotations
[R]
Array[Annotation]
comment
[R]
Comment?
location
[R]
loc?
type
[R]
Types::t
Public Class Methods
(name: TypeName, type_params: Array[TypeParam], type: Types::t, annotations: Array[Annotation], location: loc?, comment: Comment?) → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 312 def initialize(name:, type_params:, type:, annotations:, location:, comment:) @name = name @type_params = type_params @type = type @annotations = annotations @location = location @comment = comment end
Public Instance Methods
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 321 def ==(other) other.is_a?(TypeAlias) && other.name == name && other.type_params == type_params && other.type == type end
Also aliased as: eql?
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 330 def hash self.class.hash ^ name.hash ^ type_params.hash ^ type.hash end
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/lib/rbs/ast/declarations.rb, line 334 def to_json(state = nil) { declaration: :alias, name: name, type_params: type_params, type: type, annotations: annotations, location: location, comment: comment }.to_json(state) end