class Ramda::Internal::Functors::Identity

`Identity` is a functor that holds a single value, where `map` simply transforms the held value with the provided function.

Attributes

value[R]

Public Class Methods

new(value) click to toggle source
# File lib/ramda/internal/functors.rb, line 38
def initialize(value)
  @value = value
end
of(x) click to toggle source
# File lib/ramda/internal/functors.rb, line 28
def self.of(x)
  new(x)
end

Public Instance Methods

map(f) click to toggle source
# File lib/ramda/internal/functors.rb, line 32
def map(f)
  Identity.of(f.call(@value))
end