lib/rbs/ast/members.rb in rbs-0.19.0 vs lib/rbs/ast/members.rb in rbs-0.20.0
- old
+ new
@@ -214,35 +214,38 @@
end
module Attribute
attr_reader :name
attr_reader :type
+ attr_reader :kind
attr_reader :ivar_name
attr_reader :annotations
attr_reader :location
attr_reader :comment
- def initialize(name:, type:, ivar_name:, annotations:, location:, comment:)
+ def initialize(name:, type:, ivar_name:, kind:, annotations:, location:, comment:)
@name = name
@type = type
@ivar_name = ivar_name
@annotations = annotations
@location = location
@comment = comment
+ @kind = kind
end
def ==(other)
other.is_a?(self.class) &&
other.name == name &&
other.type == type &&
- other.ivar_name == ivar_name
+ other.ivar_name == ivar_name &&
+ other.kind == kind
end
alias eql? ==
def hash
- self.class.hash ^ name.hash ^ type.hash ^ ivar_name.hash
+ self.class.hash ^ name.hash ^ type.hash ^ ivar_name.hash ^ kind.hash
end
end
class AttrReader < Base
include Attribute
@@ -251,10 +254,11 @@
{
member: :attr_reader,
name: name,
type: type,
ivar_name: ivar_name,
+ kind: kind,
annotations: annotations,
location: location,
comment: comment
}.to_json(*a)
end
@@ -267,10 +271,11 @@
{
member: :attr_accessor,
name: name,
type: type,
ivar_name: ivar_name,
+ kind: kind,
annotations: annotations,
location: location,
comment: comment
}.to_json(*a)
end
@@ -283,9 +288,10 @@
{
member: :attr_writer,
name: name,
type: type,
ivar_name: ivar_name,
+ kind: kind,
annotations: annotations,
location: location,
comment: comment
}.to_json(*a)
end