class Dentaku::AST::Percentage

Public Class Methods

arity() click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 199
def self.arity
  1
end
new(child) click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 203
def initialize(child)
  @right = child

  unless valid_right?
    raise NodeError.new(:numeric, right.type, :right),
          "#{self.class} requires a numeric operand"
  end
end
precedence() click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 224
def self.precedence
  30
end

Public Instance Methods

dependencies(context = {}) click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 212
def dependencies(context = {})
  @right.dependencies(context)
end
operator() click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 220
def operator
  :%
end
value(context = {}) click to toggle source
# File lib/dentaku/ast/arithmetic.rb, line 216
def value(context = {})
  cast(right.value(context)) * 0.01
end