Sha256: 7e82f0ce133c0f11c616758976cd87789bc64f86d1535fc18666871b6c25e789

Contents?: true

Size: 460 Bytes

Versions: 4

Compression:

Stored size: 460 Bytes

Contents

# frozen_string_literal: true

require "bigdecimal"
require "cel/version"
require "cel/errors"
require "cel/ast/types"
require "cel/parser"
require "cel/macro"
require "cel/context"
require "cel/encoder" if RUBY_VERSION >= "3.1.0"
require "cel/checker"
require "cel/program"
require "cel/environment"

module Cel
  def self.to_numeric(anything)
    num = BigDecimal(anything.to_s)
    if num.frac.zero?
      num.to_i
    else
      num.to_f
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cel-0.2.3 lib/cel.rb
cel-0.2.2 lib/cel.rb
cel-0.2.1 lib/cel.rb
cel-0.2.0 lib/cel.rb