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

Included in:
AttrAccessor, AttrReader, AttrWriter
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.



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

def annotations
  @annotations
end

#commentObject (readonly)

Returns the value of attribute comment.



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

def comment
  @comment
end

#ivar_nameObject (readonly)

Returns the value of attribute ivar_name.



200
201
202
# File 'lib/rbs/ast/members.rb', line 200

def ivar_name
  @ivar_name
end

#locationObject (readonly)

Returns the value of attribute location.



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

def location
  @location
end

#nameObject (readonly)

Returns the value of attribute name.



198
199
200
# File 'lib/rbs/ast/members.rb', line 198

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



199
200
201
# File 'lib/rbs/ast/members.rb', line 199

def type
  @type
end

Instance Method Details

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



214
215
216
217
218
219
# File 'lib/rbs/ast/members.rb', line 214

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

#hashObject



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

def hash
  self.class.hash ^ name.hash ^ type.hash ^ ivar_name.hash
end

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



205
206
207
208
209
210
211
212
# File 'lib/rbs/ast/members.rb', line 205

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