Class: TRuby::IR::TypeGuard
Overview
Type guard (is_a?, respond_to?)
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#narrowed_type ⇒ Object
Returns the value of attribute narrowed_type.
-
#type_check ⇒ Object
Returns the value of attribute type_check.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(expression:, type_check:, narrowed_type: nil, **opts) ⇒ TypeGuard
constructor
A new instance of TypeGuard.
Methods inherited from Node
Constructor Details
#initialize(expression:, type_check:, narrowed_type: nil, **opts) ⇒ TypeGuard
Returns a new instance of TypeGuard.
427 428 429 430 431 432 |
# File 'lib/t_ruby/ir.rb', line 427 def initialize(expression:, type_check:, narrowed_type: nil, **opts) super(**opts) @expression = expression @type_check = type_check @narrowed_type = narrowed_type end |
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
425 426 427 |
# File 'lib/t_ruby/ir.rb', line 425 def expression @expression end |
#narrowed_type ⇒ Object
Returns the value of attribute narrowed_type.
425 426 427 |
# File 'lib/t_ruby/ir.rb', line 425 def narrowed_type @narrowed_type end |
#type_check ⇒ Object
Returns the value of attribute type_check.
425 426 427 |
# File 'lib/t_ruby/ir.rb', line 425 def type_check @type_check end |
Instance Method Details
#children ⇒ Object
434 435 436 |
# File 'lib/t_ruby/ir.rb', line 434 def children [@expression] end |