module Ramda
Ramda
library implementation, source: ramdajs.com/
rubocop:disable Performance/RedundantBlockCall
Constants
- VERSION
Public Class Methods
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
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
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
Constants are faster than module variables
# File lib/ramda.rb, line 27 def self.const_missing(name) value = { DEBUG_MODE: false }[name] value.nil? ? super : const_set(name, value) end
Returns Boolean/NilClass
# File lib/ramda.rb, line 80 def self.debug_mode DEBUG_MODE end
Takes Boolean
# File lib/ramda.rb, line 75 def self.debug_mode=(enabled) const_set('DEBUG_MODE', enabled) end
# File lib/ramda.rb, line 88 def self.exception_handler @exception_handler ||= ::Ramda::ExceptionHandler.method(:with_narrow) end
# File lib/ramda.rb, line 84 def self.exception_handler=(handler) @exception_handler = handler end