Class: Ramda::Internal::Functors::Const

Inherits:
Object
  • Object
show all
Defined in:
lib/ramda/internal/functors.rb

Overview

‘const` is a functor that effectively ignores the function given to `map`.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



6
7
8
# File 'lib/ramda/internal/functors.rb', line 6

def value
  @value
end

Class Method Details

.of(x) ⇒ Object



8
9
10
# File 'lib/ramda/internal/functors.rb', line 8

def self.of(x)
  new(x)
end

Instance Method Details

#mapObject



12
13
14
# File 'lib/ramda/internal/functors.rb', line 12

def map(*)
  Const.of(@value)
end