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.
411 412 413 414 415 416 |
# File 'lib/t_ruby/ir.rb', line 411 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.
409 410 411 |
# File 'lib/t_ruby/ir.rb', line 409 def expression @expression end |
#narrowed_type ⇒ Object
Returns the value of attribute narrowed_type.
409 410 411 |
# File 'lib/t_ruby/ir.rb', line 409 def narrowed_type @narrowed_type end |
#type_check ⇒ Object
Returns the value of attribute type_check.
409 410 411 |
# File 'lib/t_ruby/ir.rb', line 409 def type_check @type_check end |
Instance Method Details
#children ⇒ Object
418 419 420 |
# File 'lib/t_ruby/ir.rb', line 418 def children [@expression] end |