In Files

  • rbs-1.0.4/lib/rbs/ast/members.rb

Class/Module Index [+]

Quicksearch

RBS::AST::Members::MethodDefinition

Attributes

annotations[R]
comment[R]
kind[R]
location[R]
name[R]
overload[R]
types[R]

Public Class Methods

new(name:, kind:, types:, annotations:, location:, comment:, overload:) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 16
def initialize(name,, kind,, types,, annotations,, location,, comment,, overload))
  @name = name
  @kind = kind
  @types = types
  @annotations = annotations
  @location = location
  @comment = comment
  @overload = overload ? true : false
end
            

Public Instance Methods

==(other) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 26
def ==(other)
  other.is_a?(MethodDefinition) &&
    other.name == name &&
    other.kind == kind &&
    other.types == types &&
    other.overload == overload
end
            
Also aliased as: eql?
eql?(other) click to toggle source
Alias for: ==
hash() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 36
def hash
  self.class.hash ^ name.hash ^ kind.hash ^ types.hash ^ overload.hash
end
            
instance?() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 40
def instance?
  kind == :instance || kind == :singleton_instance
end
            
overload?() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 48
def overload?
  overload
end
            
singleton?() click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 44
def singleton?
  kind == :singleton || kind == :singleton_instance
end
            
to_json(*a) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 64
def to_json(*a)
  {
    member: :method_definition,
    kind: kind,
    types: types,
    annotations: annotations,
    location: location,
    comment: comment,
    overload: overload
  }.to_json(*a)
end
            
update(name: self.name, kind: self.kind, types: self.types, annotations: self.annotations, location: self.location, comment: self.comment, overload: self.overload) click to toggle source
 
               # File rbs-1.0.4/lib/rbs/ast/members.rb, line 52
def update(name: self.name, kind: self.kind, types: self.types, annotations: self.annotations, location: self.location, comment: self.comment, overload: self.overload)
  self.class.new(
    name: name,
    kind: kind,
    types: types,
    annotations: annotations,
    location: location,
    comment: comment,
    overload: overload
  )
end