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.



127
128
129
# File 'lib/rbs/ast/members.rb', line 127

def annotations
  @annotations
end

#argsObject (readonly)

Returns the value of attribute args.



126
127
128
# File 'lib/rbs/ast/members.rb', line 126

def args
  @args
end

#commentObject (readonly)

Returns the value of attribute comment.



129
130
131
# File 'lib/rbs/ast/members.rb', line 129

def comment
  @comment
end

#locationObject (readonly)

Returns the value of attribute location.



128
129
130
# File 'lib/rbs/ast/members.rb', line 128

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



125
126
127
# File 'lib/rbs/ast/members.rb', line 125

def name
  @name
end

Instance Method Details

#==(other) ⇒ Object



139
140
141
# File 'lib/rbs/ast/members.rb', line 139

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

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


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

def eql?(other)
  self == other
end

#hashObject



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

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

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



131
132
133
134
135
136
137
# File 'lib/rbs/ast/members.rb', line 131

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