Class: Baba::Expr::Unary
- Inherits:
-
Object
- Object
- Baba::Expr::Unary
- Defined in:
- lib/baba/expr.rb
Instance Attribute Summary collapse
-
#operator ⇒ Object
readonly
Returns the value of attribute operator.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(operator, right) ⇒ Unary
constructor
A new instance of Unary.
Constructor Details
#initialize(operator, right) ⇒ Unary
Returns a new instance of Unary.
138 139 140 |
# File 'lib/baba/expr.rb', line 138 def initialize(operator, right) @operator = operator; @right = right end |
Instance Attribute Details
#operator ⇒ Object (readonly)
Returns the value of attribute operator.
136 137 138 |
# File 'lib/baba/expr.rb', line 136 def operator @operator end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
136 137 138 |
# File 'lib/baba/expr.rb', line 136 def right @right end |
Instance Method Details
#accept(visitor) ⇒ Object
142 143 144 |
# File 'lib/baba/expr.rb', line 142 def accept(visitor) visitor.visit_unary_expr(self) end |