Class: RBI::Public

Inherits:
Visibility show all
Defined in:
lib/rbi/model.rb

Constant Summary collapse

DEFAULT =

Shared default instance to avoid allocating a new Public on every Method/Attr creation.

new.freeze

Instance Attribute Summary

Attributes inherited from Visibility

#visibility

Attributes inherited from NodeWithComments

#comments

Attributes inherited from Node

#loc, #parent_tree

Instance Method Summary collapse

Methods inherited from Visibility

#==, #private?, #protected?, #public?

Methods inherited from NodeWithComments

#annotations, #comments?, #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(loc: nil, comments: nil, &block) ⇒ Public

: (?loc: Loc?, ?comments: Array?) ?{ (Public node) -> void } -> void



804
805
806
807
# File 'lib/rbi/model.rb', line 804

def initialize(loc: nil, comments: nil, &block)
  super(:public, loc: loc, comments: comments)
  block&.call(self)
end