Sha256: 75d3600e31df234af5cd7d6716ac26a47a79e574738c277e51060f77ad28f30b

Contents?: true

Size: 771 Bytes

Versions: 40

Compression:

Stored size: 771 Bytes

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

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
eitil-1.1.32 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.31 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.30 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.29 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.28 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.27 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.26 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.25 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.24 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.23 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.22 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.21 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.20 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.19 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.18 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.17 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.16 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.15 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.14 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb
eitil-1.1.13 eitil_core/lib/eitil_core/type_checkers/is_num_or_nan.rb