Sha256: c1e16a51fd3980c1d82ce8fe49af7d4a7355ed363ccc0edb7545d6f666f1ba12
Contents?: true
Size: 550 Bytes
Versions: 8
Compression:
Stored size: 550 Bytes
Contents
# frozen_string_literal: true class Code class Node class Decimal < Node def initialize(parsed) @decimal = parsed.delete(:decimal) @exponent = Node::Statement.new(parsed.delete(:exponent)) if parsed.key?(:exponent) super(parsed) end def evaluate(**args) if @exponent ::Code::Object::Decimal.new( @decimal, exponent: @exponent.evaluate(**args) ) else ::Code::Object::Decimal.new(@decimal) end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems