Module: Iode::Core

Defined in:
lib/iode/core.rb,
lib/iode/core/math.rb,
lib/iode/core/lists.rb,
lib/iode/core/output.rb,
lib/iode/core/comparisons.rb

Overview

Iode Core language definitions.

This is simply a module that exposes all its instance methods as functions.

The actual functions are mixed in by other modules.

Defined Under Namespace

Modules: Comparisons, Lists, Math, Output

Class Method Summary collapse

Class Method Details

.definitionsHash

Get a singleton instance of all the core definitions.



37
38
39
40
41
42
43
44
# File 'lib/iode/core.rb', line 37

def definitions
  @definitions ||=
    Hash[
      names.zip(
        names.map(&method(:instance_method)).map{|m| m.bind(self)}
      )
    ]
end

.register(base) ⇒ Object

Register a new library of functions into the global definitions.



29
30
31
# File 'lib/iode/core.rb', line 29

def register(base)
  include(base).tap{@definitions = nil}
end