In Files

  • rbs-2.1.0/lib/rbs/ast/declarations.rb
  • rbs-2.1.0/lib/rbs/environment.rb
  • rbs-2.1.0/lib/rbs/prototype/rb.rb
  • rbs-2.1.0/lib/rbs/prototype/rbi.rb
  • rbs-2.1.0/lib/rbs/prototype/runtime.rb

Class/Module Index [+]

Quicksearch

RBS::AST::Declarations::Class

Attributes

annotations[R]
comment[R]
location[R]
members[R]
name[R]
super_class[R]
type_params[R]

Public Class Methods

new(name:, type_params:, super_class:, members:, annotations:, location:, comment:) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 95
def initialize(name,, type_params,, super_class,, members,, annotations,, location,, comment))
  @name = name
  @type_params = type_params
  @super_class = super_class
  @members = members
  @annotations = annotations
  @location = location
  @comment = comment
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 105
def ==(other)
  other.is_a?(Class) &&
    other.name == name &&
    other.type_params == type_params &&
    other.super_class == super_class &&
    other.members == members
end
            
Also aliased as: eql?
eql?(other) click to toggle source
Alias for: ==
hash() click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 115
def hash
  self.class.hash ^ name.hash ^ type_params.hash ^ super_class.hash ^ members.hash
end
            
to_json(state = _ = nil) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 119
def to_json(state = _ = nil)
  {
    declaration: :class,
    name: name,
    type_params: type_params,
    members: members,
    super_class: super_class,
    annotations: annotations,
    location: location,
    comment: comment
  }.to_json(state)
end