/rudash

Rudash - Lodash for Ruby Apps

Primary LanguageRubyMIT LicenseMIT

Rudash

Gem Version Build Status License: MIT

The Lodash popular JavaScript library exported as a Gem for Ruby developers.

Installation

gem install rudash

Usage

require 'rudash'

double = ->(value) { value * 2 }
array = [1, 2, 3]
R_.map(array, double) # => [2,4,6]

is_even = ->(value) { value.even? }
array = [1, 2, 3, 4]
R_.filter(array, is_even) # => [2,4]

# You can also use inline anonymous function style
array = [1, 2, 3, 4]
R_.filter(array,  ->(value) {
    value.even?
}) # => [2,4]

API