123456789_123456789_123456789_123456789_123456789_

Module: RBS::AST::Members::Attribute

Relationships & Source Files
Extension / Inclusion / Inheritance Descendants
Included In:
Defined in: lib/rbs/ast/members.rb

Instance Attribute Summary

Instance Method Summary

Instance Attribute Details

#annotations (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 229

attr_reader :annotations

#comment (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 231

attr_reader :comment

#ivar_name (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 228

attr_reader :ivar_name

#kind (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 227

attr_reader :kind

#location (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 230

attr_reader :location

#name (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 225

attr_reader :name

#type (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 226

attr_reader :type

#visibility (readonly)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 232

attr_reader :visibility

Instance Method Details

#==(other) Also known as: #eql?

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 245

def ==(other)
  other.is_a?(self.class) &&
    other.name == name &&
    other.type == type &&
    other.ivar_name == ivar_name &&
    other.kind == kind &&
    other.visibility == visibility
end

#eql?(other)

Alias for #==.

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 254

alias eql? ==

#hash

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 256

def hash
  name.hash ^ type.hash ^ ivar_name.hash ^ kind.hash ^ visibility.hash
end

#initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: nil)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 234

def initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:, visibility: nil)
  @name = name
  @type = type
  @ivar_name = ivar_name
  @annotations = annotations
  @location = location
  @comment = comment
  @kind = kind
  @visibility = visibility
end

#update(name: self.name, type: self.type, ivar_name: self.ivar_name, kind: self.kind, annotations: self.annotations, location: self.location, comment: self.comment, visibility: self.visibility)

[ GitHub ]

  
# File 'lib/rbs/ast/members.rb', line 260

def update(name: self.name, type: self.type, ivar_name: self.ivar_name, kind: self.kind, annotations: self.annotations, location: self.location, comment: self.comment, visibility: self.visibility)
  klass = _ = self.class
  klass.new(
    name: name,
    type: type,
    ivar_name: ivar_name,
    kind: kind,
    annotations: annotations,
    location: location,
    comment: comment,
    visibility: visibility
  )
end