Class: Chelsy::Operator::Cast

Inherits:
Prefix show all
Defined in:
lib/chelsy/ast.rb

Overview

Type cast

Instance Attribute Summary collapse

Attributes inherited from Unary

#operand

Attributes inherited from Element

#fragments, #post_fragments

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

precedence

Constructor Details

#initialize(operand, type, **rest) ⇒ Cast

Returns a new instance of Cast.



689
690
691
692
# File 'lib/chelsy/ast.rb', line 689

def initialize(operand, type, **rest)
  @type = Syntax::Type.ensure(type)
  super operand, **rest
end

Instance Attribute Details

#typeObject (readonly)

Returns the value of attribute type.



685
686
687
# File 'lib/chelsy/ast.rb', line 685

def type
  @type
end

Class Method Details

.operatorObject



687
# File 'lib/chelsy/ast.rb', line 687

def self.operator; :"()" end