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