Class: FlatMap::Mapping::Reader::Proc

Inherits:
Method show all
Defined in:
lib/flat_map/mapping/reader/proc.rb

Overview

Proc reader accepts a lambda and calls it with the target as an argument for reading.

Instance Attribute Summary

Attributes inherited from Basic

#mapping

Instance Method Summary collapse

Methods inherited from Method

#initialize

Methods inherited from Basic

#initialize

Constructor Details

This class inherits a constructor from FlatMap::Mapping::Reader::Method

Instance Method Details

#readObject

Call a @method, which is a FlatMap::Mapping::Reader::Proc object, passing the target object to it.

Returns:

  • (Object)

    value returned by reader’s lambda



10
11
12
# File 'lib/flat_map/mapping/reader/proc.rb', line 10

def read
  @method.call(target)
end