Class: Fabulator::Expr::ModExpr

Inherits:
BinExpr
  • Object
show all
Defined in:
lib/fabulator/expr/bin_expr.rb

Instance Method Summary collapse

Methods inherited from BinExpr

#expr_type, #initialize, #result_type, #run

Constructor Details

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

Instance Method Details

#calculate(a, b) ⇒ Object



148
149
150
151
# File 'lib/fabulator/expr/bin_expr.rb', line 148

def calculate(a,b)
  return nil if a.nil? || b.nil?
  a % b
end

#opObject



144
145
146
# File 'lib/fabulator/expr/bin_expr.rb', line 144

def op
  :mod
end