Sha256: 66847fe5ff67118a32603d55331667c3717d30b5046a217a2fd6273daecf2c95

Contents?: true

Size: 1.09 KB

Versions: 36

Compression:

Stored size: 1.09 KB

Contents

# require "eitil_core/type_checkers/is_num_or_nan"

require "eitil_store/regex/regex"

class String

  def is_nan?
    self !~ EitilStore::Regex::IsNum
  end

  def is_num?
    !is_nan?
  end

end

# Descending classes which are always numeric

class Numeric

  def is_nan?
    false
  end

  def is_num?
    true
  end

end

# Classes which are never numeric

class NilClass

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class TrueClass

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class FalseClass

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class Hash

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class Array

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class Date

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class DateTime

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class Time

  def is_nan?
    true
  end

  def is_num?
    false
  end

end


class ActiveSupport::TimeWithZone

  def is_nan?
    true
  end

  def is_num?
    false
  end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
eitil-2.0.8 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.7 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.6 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.5 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.4 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.3 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.2 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.1 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-2.0.0 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.4.1 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.4.0 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.12 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.11 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.10 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.9 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.8 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.7 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.6 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.5 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.3.4 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb