Class: MiniRuby::CallInfo
- Inherits:
-
Object
- Object
- MiniRuby::CallInfo
- Extended by:
- T::Sig
- Defined in:
- lib/miniruby/call_info.rb
Overview
Contains details about a function call like the name of the called function and the number of arguments.
Instance Attribute Summary collapse
-
#arg_count ⇒ Object
readonly
: Integer.
-
#name ⇒ Object
readonly
: Symbol.
Instance Method Summary collapse
-
#==(other) ⇒ Object
: (Object other) -> bool.
-
#initialize(name:, arg_count:) ⇒ CallInfo
constructor
: (name: Symbol, arg_count: Integer) -> void.
Constructor Details
#initialize(name:, arg_count:) ⇒ CallInfo
: (name: Symbol, arg_count: Integer) -> void
17 18 19 20 |
# File 'lib/miniruby/call_info.rb', line 17 def initialize(name:, arg_count:) @name = name @arg_count = arg_count end |
Instance Attribute Details
#arg_count ⇒ Object (readonly)
: Integer
14 15 16 |
# File 'lib/miniruby/call_info.rb', line 14 def arg_count @arg_count end |
#name ⇒ Object (readonly)
: Symbol
11 12 13 |
# File 'lib/miniruby/call_info.rb', line 11 def name @name end |
Instance Method Details
#==(other) ⇒ Object
: (Object other) -> bool
23 24 25 26 27 |
# File 'lib/miniruby/call_info.rb', line 23 def ==(other) return false unless other.is_a?(CallInfo) @name == other.name && @arg_count == other.arg_count end |