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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#annotationsArray[Annotation] (readonly)

Returns the value of attribute annotations.

Returns:



190
191
192
# File 'lib/rbs/ast/members.rb', line 190

def annotations
  @annotations
end

#argsArray[Types::t] (readonly)

Returns the value of attribute args.

Returns:

  • (Array[Types::t])


189
190
191
# File 'lib/rbs/ast/members.rb', line 189

def args
  @args
end

#commentComment? (readonly)

Returns the value of attribute comment.

Returns:



192
193
194
# File 'lib/rbs/ast/members.rb', line 192

def comment
  @comment
end

#locationloc? (readonly)

Returns the value of attribute location.

Returns:

  • (loc, nil)


191
192
193
# File 'lib/rbs/ast/members.rb', line 191

def location
  @location
end

#nameTypeName (readonly)

Returns the value of attribute name.

Returns:



188
189
190
# File 'lib/rbs/ast/members.rb', line 188

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



202
203
204
# File 'lib/rbs/ast/members.rb', line 202

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


206
207
208
# File 'lib/rbs/ast/members.rb', line 206

def eql?(other)
  self == other
end

#hashObject



210
211
212
# File 'lib/rbs/ast/members.rb', line 210

def hash
  name.hash ^ args.hash
end

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

Returns a new instance of Mixin.

Parameters:

Returns:

  • (Mixin)

    a new instance of Mixin



194
195
196
197
198
199
200
# File 'lib/rbs/ast/members.rb', line 194

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