Class: RBI::Send
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Send
- Includes:
- Indexable
- Defined in:
- lib/rbi/model.rb,
lib/rbi/index.rb,
lib/rbi/rewriters/merge_trees.rb
Overview
Sends
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
: Array.
-
#method ⇒ Object
readonly
: String.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
-
#<<(arg) ⇒ Object
: (Arg arg) -> void.
-
#==(other) ⇒ Object
: (Object? other) -> bool.
-
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool.
-
#index_ids ⇒ Object
: -> Array.
- #initialize(method, args = [], loc: nil, comments: nil, &block) ⇒ Send constructor
-
#to_s ⇒ Object
: -> String.
Methods inherited from NodeWithComments
#annotations, #comments?, #merge_with, #version_requirements
Methods inherited from Node
#detach, #merge_with, #parent_conflict_tree, #parent_scope, #print, #rbs_print, #rbs_string, #replace, #satisfies_version?, #string
Constructor Details
#initialize(method, args = [], loc: nil, comments: nil, &block) ⇒ Send
839 840 841 842 843 844 |
# File 'lib/rbi/model.rb', line 839 def initialize(method, args = [], loc: nil, comments: nil, &block) super(loc: loc, comments: comments) @method = method @args = args block&.call(self) end |
Instance Attribute Details
#args ⇒ Object (readonly)
: Array
836 837 838 |
# File 'lib/rbi/model.rb', line 836 def args @args end |
#method ⇒ Object (readonly)
: String
833 834 835 |
# File 'lib/rbi/model.rb', line 833 def method @method end |
Instance Method Details
#<<(arg) ⇒ Object
: (Arg arg) -> void
847 848 849 |
# File 'lib/rbi/model.rb', line 847 def <<(arg) @args << arg end |
#==(other) ⇒ Object
: (Object? other) -> bool
852 853 854 |
# File 'lib/rbi/model.rb', line 852 def ==(other) Send === other && method == other.method && args == other.args end |
#compatible_with?(other) ⇒ Boolean
: (Node other) -> bool
548 549 550 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 548 def compatible_with?(other) other.is_a?(Send) && method == other.method && args == other.args end |
#index_ids ⇒ Object
: -> Array
184 185 186 |
# File 'lib/rbi/index.rb', line 184 def index_ids ["#{parent_scope&.fully_qualified_name}.#{method}"] end |
#to_s ⇒ Object
: -> String
857 858 859 |
# File 'lib/rbi/model.rb', line 857 def to_s "#{parent_scope&.fully_qualified_name}.#{method}(#{args.join(", ")})" end |