module Ramda

Ramda library implementation, source: ramdajs.com/

rubocop:disable Performance/RedundantBlockCall

Constants

VERSION

Public Class Methods

F() click to toggle source

A function that always returns false. Any passed in parameters are ignored.

  • -> Boolean

rubocop:disable Style/MethodName

# File lib/ramda.rb, line 59
def self.F
  ->(*) { false }
end
T() click to toggle source

A function that always returns true. Any passed in parameters are ignored.

  • -> Boolean

rubocop:disable Style/MethodName

# File lib/ramda.rb, line 69
def self.T
  ->(*) { true }
end
__() click to toggle source

A special placeholder value used to specify “gaps” within curried functions, allowing partial application of any combination of arguments, regardless of their positions.

If g is a curried ternary function and _ is R.__, the following are equivalent:

g(1, 2, 3) g(_, 2, 3)(1) g(_, _, 3)(1)(2) g(_, _, 3)(1, 2) g(_, 2, _)(1, 3) g(_, 2)(1)(3) g(_, 2)(1, 3) g(_, 2)(_, 3)(1)

# File lib/ramda.rb, line 50
def self.__
  :ramda_placeholder
end
const_missing(name) click to toggle source

Constants are faster than module variables

Calls superclass method
# File lib/ramda.rb, line 27
def self.const_missing(name)
  value = {
    DEBUG_MODE: false
  }[name]

  value.nil? ? super : const_set(name, value)
end
debug_mode() click to toggle source

Returns Boolean/NilClass

# File lib/ramda.rb, line 80
def self.debug_mode
  DEBUG_MODE
end
debug_mode=(enabled) click to toggle source

Takes Boolean

# File lib/ramda.rb, line 75
def self.debug_mode=(enabled)
  const_set('DEBUG_MODE', enabled)
end
exception_handler() click to toggle source
# File lib/ramda.rb, line 88
def self.exception_handler
  @exception_handler ||= ::Ramda::ExceptionHandler.method(:with_narrow)
end
exception_handler=(handler) click to toggle source
# File lib/ramda.rb, line 84
def self.exception_handler=(handler)
  @exception_handler = handler
end