Class: RBI::VisibilityGroup
- Inherits:
-
Tree
- Object
- Node
- NodeWithComments
- Tree
- RBI::VisibilityGroup
- Extended by:
- T::Sig
- Defined in:
- lib/rbi/printer.rb,
lib/rbi/rewriters/nest_non_public_methods.rb
Instance Attribute Summary collapse
-
#visibility ⇒ Object
readonly
Returns the value of attribute visibility.
Attributes inherited from Tree
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #accept_printer(v) ⇒ Object
-
#initialize(visibility) ⇒ VisibilityGroup
constructor
A new instance of VisibilityGroup.
- #oneline? ⇒ Boolean
Methods inherited from Tree
#<<, #add_sig_templates!, #annotate!, #deannotate!, #empty?, #group_nodes!, #index, #merge, #nest_non_public_methods!, #nest_singleton_methods!, #sort_nodes!
Methods inherited from NodeWithComments
Methods inherited from Node
#compatible_with?, #detach, #group_kind, #merge_with, #parent_conflict_tree, #parent_scope, #print, #print_blank_line_before, #replace, #string
Constructor Details
#initialize(visibility) ⇒ VisibilityGroup
Returns a new instance of VisibilityGroup.
58 59 60 61 |
# File 'lib/rbi/rewriters/nest_non_public_methods.rb', line 58 def initialize(visibility) super() @visibility = visibility end |
Instance Attribute Details
#visibility ⇒ Object (readonly)
Returns the value of attribute visibility.
55 56 57 |
# File 'lib/rbi/rewriters/nest_non_public_methods.rb', line 55 def visibility @visibility end |
Instance Method Details
#accept_printer(v) ⇒ Object
780 781 782 783 784 785 786 787 788 789 790 |
# File 'lib/rbi/printer.rb', line 780 def accept_printer(v) v.in_visibility_group = true if visibility.public? v.printn unless v.previous_node.nil? else v.visit(visibility) v.printn end v.visit_all(nodes) v.in_visibility_group = false end |
#oneline? ⇒ Boolean
793 794 795 |
# File 'lib/rbi/printer.rb', line 793 def oneline? false end |