In Files

  • rbs-2.1.0/lib/rbs/ast/declarations.rb

Class/Module Index [+]

Quicksearch

RBS::AST::Declarations::Interface

Attributes

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

Public Class Methods

new(name:, type_params:, members:, annotations:, location:, comment:) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 231
def initialize(name,, type_params,, members,, annotations,, location,, comment))
  @name = name
  @type_params = type_params
  @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 240
def ==(other)
  other.is_a?(Interface) &&
    other.name == name &&
    other.type_params == type_params &&
    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 249
def hash
  self.class.hash ^ type_params.hash ^ members.hash
end
            
to_json(state = _ = nil) click to toggle source
 
               # File rbs-2.1.0/lib/rbs/ast/declarations.rb, line 253
def to_json(state = _ = nil)
  {
    declaration: :interface,
    name: name,
    type_params: type_params,
    members: members,
    annotations: annotations,
    location: location,
    comment: comment
  }.to_json(state)
end