Class: RBI::Send
Overview
Instance Attribute Summary collapse
#comments
Attributes inherited from Node
#loc, #parent_tree
Instance Method Summary
collapse
#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
Returns a new instance of Send.
955
956
957
958
959
960
|
# File 'lib/rbi/model.rb', line 955
def initialize(method, args = [], loc: nil, comments: nil, &block)
super(loc: loc, comments: )
@method = method
@args = args
block&.call(self)
end
|
Instance Attribute Details
#args ⇒ Object
952
953
954
|
# File 'lib/rbi/model.rb', line 952
def args
@args
end
|
#method ⇒ Object
949
950
951
|
# File 'lib/rbi/model.rb', line 949
def method
@method
end
|
Instance Method Details
#<<(arg) ⇒ Object
963
964
965
|
# File 'lib/rbi/model.rb', line 963
def <<(arg)
@args << arg
end
|
#==(other) ⇒ Object
968
969
970
|
# File 'lib/rbi/model.rb', line 968
def ==(other)
Send === other && method == other.method && args == other.args
end
|
#compatible_with?(other) ⇒ Boolean
591
592
593
|
# File 'lib/rbi/rewriters/merge_trees.rb', line 591
def compatible_with?(other)
other.is_a?(Send) && method == other.method && args == other.args
end
|
#index_ids ⇒ Object
184
185
186
|
# File 'lib/rbi/index.rb', line 184
def index_ids
["#{parent_scope&.fully_qualified_name}.#{method}"]
end
|
#to_s ⇒ Object
973
974
975
|
# File 'lib/rbi/model.rb', line 973
def to_s
"#{parent_scope&.fully_qualified_name}.#{method}(#{args.join(", ")})"
end
|