Module: Ramda

Extended by:
Function, Internal::Java::MakeCurryProc, List, Logic, Math, Object, Relation, String, Type
Defined in:
lib/ramda.rb,
lib/ramda/list.rb,
lib/ramda/math.rb,
lib/ramda/type.rb,
lib/ramda/logic.rb,
lib/ramda/object.rb,
lib/ramda/string.rb,
lib/ramda/version.rb,
lib/ramda/function.rb,
lib/ramda/relation.rb,
lib/ramda/exception_handler.rb,
lib/ramda/internal/functors.rb,
lib/ramda/internal/transducers.rb,
lib/ramda/internal/dispatchable.rb,
lib/ramda/internal/curried_method.rb,
lib/ramda/internal/function_with_arity.rb,
lib/ramda/internal/class_which_respond_to.rb,
lib/ramda/internal/transducers/transducer.rb,
lib/ramda/internal/java/__make_curry_proc__.rb,
lib/ramda/internal/transducers/map_transducer.rb,
lib/ramda/internal/transducers/take_transducer.rb,
lib/ramda/internal/transducers/filter_transdurer.rb,
lib/ramda/internal/transducers/drop_repeats_transducer.rb,
lib/ramda/internal/transducers/drop_repeats_with_transducer.rb

Overview

rubocop:disable Performance/RedundantBlockCall

Defined Under Namespace

Modules: ExceptionHandler, Function, Internal, List, Logic, Math, Object, Relation, String, Type

Constant Summary collapse

VERSION =
'0.16.0'.freeze

Constants included from List

List::Trans

Constants included from Object

Object::Functors

Class Method Summary collapse

Methods included from Internal::CurriedMethod

#curried, #curried_method_body, #debug_log, #replace_placeholder

Methods included from Internal::Dispatchable

#dispatchable, #dispatchable1, #dispatchable_error

Methods included from Internal::ClassWhichRespondTo

#class_which_responds_to

Methods included from List

type_error

Methods included from String

type_error

Methods included from Internal::Java::MakeCurryProc

__make_curry_proc__

Class Method Details

.__Object

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)



50
51
52
# File 'lib/ramda.rb', line 50

def self.__
  :ramda_placeholder
end

.const_missing(name) ⇒ Object

Constants are faster than module variables



27
28
29
30
31
32
33
# 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_modeObject

Returns Boolean/NilClass



80
81
82
# File 'lib/ramda.rb', line 80

def self.debug_mode
  DEBUG_MODE
end

.debug_mode=(enabled) ⇒ Object

Takes Boolean



75
76
77
# File 'lib/ramda.rb', line 75

def self.debug_mode=(enabled)
  const_set('DEBUG_MODE', enabled)
end

.exception_handlerObject



88
89
90
# File 'lib/ramda.rb', line 88

def self.exception_handler
  @exception_handler ||= ::Ramda::ExceptionHandler.method(:with_narrow)
end

.exception_handler=(handler) ⇒ Object



84
85
86
# File 'lib/ramda.rb', line 84

def self.exception_handler=(handler)
  @exception_handler = handler
end

.FObject

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

  • -> Boolean

rubocop:disable Style/MethodName



59
60
61
# File 'lib/ramda.rb', line 59

def self.F
  ->(*) { false }
end

.TObject

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

  • -> Boolean

rubocop:disable Style/MethodName



69
70
71
# File 'lib/ramda.rb', line 69

def self.T
  ->(*) { true }
end