Module: RBS::AST::Members::Mixin

Included in:
Extend, Include, Prepend
Defined in:
lib/rbs/ast/members.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#annotationsObject (readonly)

Returns the value of attribute annotations.



152
153
154
# File 'lib/rbs/ast/members.rb', line 152

def annotations
  @annotations
end

#argsObject (readonly)

Returns the value of attribute args.



151
152
153
# File 'lib/rbs/ast/members.rb', line 151

def args
  @args
end

#commentObject (readonly)

Returns the value of attribute comment.



154
155
156
# File 'lib/rbs/ast/members.rb', line 154

def comment
  @comment
end

#locationObject (readonly)

Returns the value of attribute location.



153
154
155
# File 'lib/rbs/ast/members.rb', line 153

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



150
151
152
# File 'lib/rbs/ast/members.rb', line 150

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



164
165
166
# File 'lib/rbs/ast/members.rb', line 164

def ==(other)
  other.is_a?(self.class) && other.name == name && other.args == args
end

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


168
169
170
# File 'lib/rbs/ast/members.rb', line 168

def eql?(other)
  self == other
end

#hashObject



172
173
174
# File 'lib/rbs/ast/members.rb', line 172

def hash
  name.hash ^ args.hash
end

#initialize(name:, args:, annotations:, location:, comment:) ⇒ Object



156
157
158
159
160
161
162
# File 'lib/rbs/ast/members.rb', line 156

def initialize(name:, args:, annotations:, location:, comment:)
  @name = name
  @args = args
  @annotations = annotations
  @location = location
  @comment = comment
end