Class: Fabulator::Expr::NegExpr

Inherits:
UnaryExpr show all
Defined in:
lib/fabulator/expr/unary_expr.rb

Instance Method Summary collapse

Methods inherited from UnaryExpr

#initialize, #run

Constructor Details

This class inherits a constructor from Fabulator::Expr::UnaryExpr

Instance Method Details

#calculate(e) ⇒ Object



25
26
27
# File 'lib/fabulator/expr/unary_expr.rb', line 25

def calculate(e)
  e.nil? ? nil : -e
end