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.



146
147
148
# File 'lib/rbs/ast/members.rb', line 146

def annotations
  @annotations
end

#argsObject (readonly)

Returns the value of attribute args.



145
146
147
# File 'lib/rbs/ast/members.rb', line 145

def args
  @args
end

#commentObject (readonly)

Returns the value of attribute comment.



148
149
150
# File 'lib/rbs/ast/members.rb', line 148

def comment
  @comment
end

#locationObject (readonly)

Returns the value of attribute location.



147
148
149
# File 'lib/rbs/ast/members.rb', line 147

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



144
145
146
# File 'lib/rbs/ast/members.rb', line 144

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



158
159
160
# File 'lib/rbs/ast/members.rb', line 158

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


162
163
164
# File 'lib/rbs/ast/members.rb', line 162

def eql?(other)
  self == other
end

#hashObject



166
167
168
# File 'lib/rbs/ast/members.rb', line 166

def hash
  self.class.hash ^ name.hash ^ args.hash
end

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



150
151
152
153
154
155
156
# File 'lib/rbs/ast/members.rb', line 150

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