Sha256: fe667f44d06e0536e7640bc8f1ec586619bd05bddea674ff4ea9557e837c4ef5

Contents?: true

Size: 552 Bytes

Versions: 3

Compression:

Stored size: 552 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/checker"
require "cel/program"
require "cel/environment"

begin
  require "google/protobuf/well_known_types"
  require "cel/protobuf"
rescue LoadError # rubocop:disable Lint/SuppressedException
end

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

3 entries across 3 versions & 1 rubygems

Version Path
cel-0.1.2 lib/cel.rb
cel-0.1.1 lib/cel.rb
cel-0.1.0 lib/cel.rb