Class: Seaquel::AST::Unary
- Inherits:
-
Expression
- Object
- Expression
- Seaquel::AST::Unary
- Defined in:
- lib/seaquel/ast/unary.rb
Instance Attribute Summary collapse
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
-
#op ⇒ Object
readonly
Returns the value of attribute op.
Instance Method Summary collapse
-
#initialize(op, exp) ⇒ Unary
constructor
A new instance of Unary.
- #inspect ⇒ Object
- #visit(visitor) ⇒ Object
Methods inherited from Expression
#as, #asc, binop, #desc, joinop, #lisp_inspect, unaryop
Constructor Details
#initialize(op, exp) ⇒ Unary
Returns a new instance of Unary.
7 8 9 10 |
# File 'lib/seaquel/ast/unary.rb', line 7 def initialize op, exp @exp = exp @op = op end |
Instance Attribute Details
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
4 5 6 |
# File 'lib/seaquel/ast/unary.rb', line 4 def exp @exp end |
#op ⇒ Object (readonly)
Returns the value of attribute op.
5 6 7 |
# File 'lib/seaquel/ast/unary.rb', line 5 def op @op end |
Instance Method Details
#inspect ⇒ Object
16 17 18 |
# File 'lib/seaquel/ast/unary.rb', line 16 def inspect "(#{op.inspect} #{exp.inspect})" end |
#visit(visitor) ⇒ Object
12 13 14 |
# File 'lib/seaquel/ast/unary.rb', line 12 def visit visitor visitor.visit_unary op, exp end |