Class: RBI::Visibility
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Visibility
- Extended by:
- T::Helpers, T::Sig
- Defined in:
- lib/rbi/model.rb
Overview
Visibility
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(visibility, loc: nil, comments: []) ⇒ Visibility
constructor
A new instance of Visibility.
- #private? ⇒ Boolean
- #protected? ⇒ Boolean
- #public? ⇒ Boolean
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
Returns a new instance of Visibility.
926 927 928 929 |
# File 'lib/rbi/model.rb', line 926 def initialize(visibility, loc: nil, comments: []) super(loc: loc, comments: comments) @visibility = visibility end |
Instance Attribute Details
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
923 924 925 |
# File 'lib/rbi/model.rb', line 923 def visibility @visibility end |
Instance Method Details
#==(other) ⇒ Object
932 933 934 935 936 |
# File 'lib/rbi/model.rb', line 932 def ==(other) return false unless other.is_a?(Visibility) visibility == other.visibility end |
#private? ⇒ Boolean
949 950 951 |
# File 'lib/rbi/model.rb', line 949 def private? visibility == :private end |
#protected? ⇒ Boolean
944 945 946 |
# File 'lib/rbi/model.rb', line 944 def protected? visibility == :protected end |
#public? ⇒ Boolean
939 940 941 |
# File 'lib/rbi/model.rb', line 939 def public? visibility == :public end |