Class: RBI::Visibility Abstract
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Visibility
- Defined in:
- lib/rbi/model.rb
Overview
This class is abstract.
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
: Symbol.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (Object? other) -> bool.
-
#initialize(visibility, loc: nil, comments: []) ⇒ Visibility
constructor
: (Symbol visibility, ?loc: Loc?, ?comments: Array) -> void.
-
#private? ⇒ Boolean
: -> bool.
-
#protected? ⇒ Boolean
: -> bool.
-
#public? ⇒ Boolean
: -> bool.
Methods inherited from NodeWithComments
#annotations, #merge_with, #version_requirements
Methods inherited from Node
#compatible_with?, #detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(visibility, loc: nil, comments: []) ⇒ Visibility
: (Symbol visibility, ?loc: Loc?, ?comments: Array) -> void
748 749 750 751 |
# File 'lib/rbi/model.rb', line 748 def initialize(visibility, loc: nil, comments: []) super(loc: loc, comments: comments) @visibility = visibility end |
Instance Attribute Details
#visibility ⇒ Object (readonly)
: Symbol
745 746 747 |
# File 'lib/rbi/model.rb', line 745 def visibility @visibility end |
Instance Method Details
#==(other) ⇒ Object
: (Object? other) -> bool
754 755 756 757 758 |
# File 'lib/rbi/model.rb', line 754 def ==(other) return false unless other.is_a?(Visibility) visibility == other.visibility end |
#private? ⇒ Boolean
: -> bool
771 772 773 |
# File 'lib/rbi/model.rb', line 771 def private? visibility == :private end |
#protected? ⇒ Boolean
: -> bool
766 767 768 |
# File 'lib/rbi/model.rb', line 766 def protected? visibility == :protected end |
#public? ⇒ Boolean
: -> bool
761 762 763 |
# File 'lib/rbi/model.rb', line 761 def public? visibility == :public end |