sig/members.rbs in rbs-2.1.0 vs sig/members.rbs in rbs-2.2.0
- old
+ new
@@ -10,45 +10,49 @@
# Base class for members.
class Base
end
+ type visibility = :public | :private
+
class MethodDefinition < Base
type kind = :instance | :singleton | :singleton_instance
# def foo: () -> void
# ^^^ keyword
# ^^^ name
#
- # def self.bar: () -> void | ...
- # ^^^ keyword
- # ^^^^^ kind
- # ^^^ name
- # ^^^ overload
+ # private def self.bar: () -> void | ...
+ # ^^^^^^^ visibility
+ # ^^^ keyword
+ # ^^^^^ kind
+ # ^^^ name
+ # ^^^ overload
#
- type loc = Location[:keyword | :name, :kind | :overload]
+ type loc = Location[:keyword | :name, :kind | :overload | :visibility]
attr_reader name: Symbol
attr_reader kind: kind
attr_reader types: Array[MethodType]
attr_reader annotations: Array[Annotation]
attr_reader location: loc?
attr_reader comment: Comment?
attr_reader overload: bool
+ attr_reader visibility: visibility?
- def initialize: (name: Symbol, kind: kind, types: Array[MethodType], annotations: Array[Annotation], location: loc?, comment: Comment?, overload: boolish) -> void
+ def initialize: (name: Symbol, kind: kind, types: Array[MethodType], annotations: Array[Annotation], location: loc?, comment: Comment?, overload: boolish, ?visibility: visibility?) -> void
include _HashEqual
include _ToJson
def instance?: () -> bool
def singleton?: () -> bool
def overload?: () -> bool
- def update: (?name: Symbol, ?kind: kind, ?types: Array[MethodType], ?annotations: Array[Annotation], ?location: loc?, ?comment: Comment?, ?overload: boolish) -> MethodDefinition
+ def update: (?name: Symbol, ?kind: kind, ?types: Array[MethodType], ?annotations: Array[Annotation], ?location: loc?, ?comment: Comment?, ?overload: boolish, ?visibility: visibility?) -> MethodDefinition
end
module Var
# @foo: String
# ^^^^ name
@@ -131,32 +135,34 @@
# attr_reader name: String
# ^^^^^^^^^^^ keyword
# ^^^^ name
# ^ colon
#
- # attr_accessor self.name (@foo) : String
- # ^^^^^^^^^^^^^ keyword
- # ^^^^^ kind
- # ^^^^ name
- # ^^^^^^ ivar
- # ^^^^ ivar_name
- # ^ colon
+ # public attr_accessor self.name (@foo) : String
+ # ^^^^^^ visibility
+ # ^^^^^^^^^^^^^ keyword
+ # ^^^^^ kind
+ # ^^^^ name
+ # ^^^^^^ ivar
+ # ^^^^ ivar_name
+ # ^ colon
#
- type loc = Location[:keyword | :name | :colon, :kind | :ivar | :ivar_name]
+ type loc = Location[:keyword | :name | :colon, :kind | :ivar | :ivar_name | :visibility]
attr_reader name: Symbol
attr_reader type: Types::t
attr_reader kind: kind
attr_reader ivar_name: Symbol | false | nil
attr_reader annotations: Array[Annotation]
attr_reader location: loc?
attr_reader comment: Comment?
+ attr_reader visibility: visibility?
- def initialize: (name: Symbol, type: Types::t, ivar_name: Symbol | false | nil, kind: kind, annotations: Array[Annotation], location: loc?, comment: Comment?) -> void
+ def initialize: (name: Symbol, type: Types::t, ivar_name: Symbol | false | nil, kind: kind, annotations: Array[Annotation], location: loc?, comment: Comment?, ?visibility: visibility?) -> void
include _HashEqual
- def update: (?name: Symbol, ?type: Types::t, ?ivar_name: Symbol | false | nil, ?kind: kind, ?annotations: Array[Annotation], ?location: loc?, ?comment: Comment?) -> instance
+ def update: (?name: Symbol, ?type: Types::t, ?ivar_name: Symbol | false | nil, ?kind: kind, ?annotations: Array[Annotation], ?location: loc?, ?comment: Comment?, ?visibility: visibility) -> instance
end
class AttrReader < Base
include Attribute
include _ToJson