Class: Chelsy::Operator::Binary

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

Instance Attribute Summary collapse

Attributes inherited from Element

#fragments, #post_fragments

Instance Method Summary collapse

Methods inherited from Base

operator, precedence

Constructor Details

#initialize(lhs, rhs, **rest) ⇒ Binary

Returns a new instance of Binary.



566
567
568
569
570
# File 'lib/chelsy/ast.rb', line 566

def initialize(lhs, rhs, **rest)
  @lhs = Syntax::Expr.ensure(lhs)
  @rhs = Syntax::Expr.ensure(rhs)
  super **rest
end

Instance Attribute Details

#lhsObject (readonly)

Returns the value of attribute lhs.



564
565
566
# File 'lib/chelsy/ast.rb', line 564

def lhs
  @lhs
end

#rhsObject (readonly)

Returns the value of attribute rhs.



564
565
566
# File 'lib/chelsy/ast.rb', line 564

def rhs
  @rhs
end