Class: TRuby::IR::TypeCast
Overview
Type cast / assertion
Instance Attribute Summary collapse
-
#expression ⇒ Object
Returns the value of attribute expression.
-
#kind ⇒ Object
Returns the value of attribute kind.
-
#target_type ⇒ Object
Returns the value of attribute target_type.
Attributes inherited from Node
#location, #metadata, #type_info
Instance Method Summary collapse
- #children ⇒ Object
-
#initialize(expression:, target_type:, kind: :as, **opts) ⇒ TypeCast
constructor
kind: :as, :assert.
Methods inherited from Node
Constructor Details
#initialize(expression:, target_type:, kind: :as, **opts) ⇒ TypeCast
kind: :as, :assert
395 396 397 398 399 400 |
# File 'lib/t_ruby/ir.rb', line 395 def initialize(expression:, target_type:, kind: :as, **opts) super(**opts) @expression = expression @target_type = target_type @kind = kind end |
Instance Attribute Details
#expression ⇒ Object
Returns the value of attribute expression.
392 393 394 |
# File 'lib/t_ruby/ir.rb', line 392 def expression @expression end |
#kind ⇒ Object
Returns the value of attribute kind.
392 393 394 |
# File 'lib/t_ruby/ir.rb', line 392 def kind @kind end |
#target_type ⇒ Object
Returns the value of attribute target_type.
392 393 394 |
# File 'lib/t_ruby/ir.rb', line 392 def target_type @target_type end |
Instance Method Details
#children ⇒ Object
402 403 404 |
# File 'lib/t_ruby/ir.rb', line 402 def children [@expression] end |