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
425 426 427 428 429 430 |
# File 'lib/t_ruby/ir.rb', line 425 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.
422 423 424 |
# File 'lib/t_ruby/ir.rb', line 422 def expression @expression end |
#kind ⇒ Object
Returns the value of attribute kind.
422 423 424 |
# File 'lib/t_ruby/ir.rb', line 422 def kind @kind end |
#target_type ⇒ Object
Returns the value of attribute target_type.
422 423 424 |
# File 'lib/t_ruby/ir.rb', line 422 def target_type @target_type end |
Instance Method Details
#children ⇒ Object
432 433 434 |
# File 'lib/t_ruby/ir.rb', line 432 def children [@expression] end |