Module: Spark::CoreExtension::Integer

Defined in:
lib/spark/ext/integer.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/spark/ext/integer.rb', line 10

def self.included(base)
  base.extend(ClassMethods)
  base.send(:include, InstanceMethods)
  base.class_eval do
    const_set :MAX_WITH_SPARK, 1 << (1.size * 8 - 2) - 1
    const_set :MIN_WITH_SPARK, -const_get(:MAX_WITH_SPARK) - 1

    path_const_unless_exist :MAX, :SPARK
    path_const_unless_exist :MIN, :SPARK
  end
end