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.
441 442 443 444 445 446 |
# File 'lib/t_ruby/ir.rb', line 441 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.
439 440 441 |
# File 'lib/t_ruby/ir.rb', line 439 def expression @expression end |
#narrowed_type ⇒ Object
Returns the value of attribute narrowed_type.
439 440 441 |
# File 'lib/t_ruby/ir.rb', line 439 def narrowed_type @narrowed_type end |
#type_check ⇒ Object
Returns the value of attribute type_check.
439 440 441 |
# File 'lib/t_ruby/ir.rb', line 439 def type_check @type_check end |
Instance Method Details
#children ⇒ Object
448 449 450 |
# File 'lib/t_ruby/ir.rb', line 448 def children [@expression] end |