Class: Each::Filter

Inherits:
Struct
  • Object
show all
Defined in:
lib/ruby-optics/each.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blkObject

Returns the value of attribute blk

Returns:

  • (Object)

    the current value of blk



8
9
10
# File 'lib/ruby-optics/each.rb', line 8

def blk
  @blk
end

#focusObject

Returns the value of attribute focus

Returns:

  • (Object)

    the current value of focus



8
9
10
# File 'lib/ruby-optics/each.rb', line 8

def focus
  @focus
end

Instance Method Details

#call(object) ⇒ Object



9
10
11
# File 'lib/ruby-optics/each.rb', line 9

def call(object)
  blk.(focus.get(object))
end