Sha256: 2e56c925348df861fd790bd11ba591d2a23c061800789c6a20fc712dce60b877

Contents?: true

Size: 383 Bytes

Versions: 9

Compression:

Stored size: 383 Bytes

Contents

module Datagrid
  module Utils
    class << self

      TRUTH = [true, 1, "1", "true", "yes", "on"]

      def booleanize(value)
        TRUTH.include?(value)
      end

      def warn_once(message)
        @warnings ||= {}
        if @warnings[message] 
          false
        else
          warn message
          @warnings[message] = true
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
datagrid-0.6.4 lib/datagrid/utils.rb
datagrid-0.6.3 lib/datagrid/utils.rb
datagrid-0.6.2 lib/datagrid/utils.rb
datagrid-0.6.0 lib/datagrid/utils.rb
datagrid-0.5.4 lib/datagrid/utils.rb
datagrid-0.5.3 lib/datagrid/utils.rb
datagrid-0.5.2 lib/datagrid/utils.rb
datagrid-0.5.1 lib/datagrid/utils.rb
datagrid-0.5.0 lib/datagrid/utils.rb