Class: RBI::Send
- Inherits:
-
NodeWithComments
- Object
- Node
- NodeWithComments
- RBI::Send
- Extended by:
- T::Sig
- 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
Returns the value of attribute args.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
Attributes inherited from NodeWithComments
Attributes inherited from Node
Instance Method Summary collapse
- #<<(arg) ⇒ Object
- #==(other) ⇒ Object
- #compatible_with?(other) ⇒ Boolean
- #index_ids ⇒ Object
-
#initialize(method, args = [], loc: nil, comments: [], &block) ⇒ Send
constructor
A new instance of Send.
- #to_s ⇒ Object
Methods inherited from NodeWithComments
#annotations, #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: [], &block) ⇒ Send
Returns a new instance of Send.
1022 1023 1024 1025 1026 1027 |
# File 'lib/rbi/model.rb', line 1022 def initialize(method, args = [], loc: nil, comments: [], &block) super(loc: loc, comments: comments) @method = method @args = args block&.call(self) end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
1011 1012 1013 |
# File 'lib/rbi/model.rb', line 1011 def args @args end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
1008 1009 1010 |
# File 'lib/rbi/model.rb', line 1008 def method @method end |
Instance Method Details
#<<(arg) ⇒ Object
1030 1031 1032 |
# File 'lib/rbi/model.rb', line 1030 def <<(arg) @args << arg end |
#==(other) ⇒ Object
1035 1036 1037 |
# File 'lib/rbi/model.rb', line 1035 def ==(other) Send === other && method == other.method && args == other.args end |
#compatible_with?(other) ⇒ Boolean
537 538 539 |
# File 'lib/rbi/rewriters/merge_trees.rb', line 537 def compatible_with?(other) other.is_a?(Send) && method == other.method && args == other.args end |
#index_ids ⇒ Object
193 194 195 |
# File 'lib/rbi/index.rb', line 193 def index_ids ["#{parent_scope&.fully_qualified_name}.#{method}"] end |
#to_s ⇒ Object
1040 1041 1042 |
# File 'lib/rbi/model.rb', line 1040 def to_s "#{parent_scope&.fully_qualified_name}.#{method}(#{args.join(", ")})" end |