Class: ConvenientService::Utils::Array::FindLast

Inherits:
Support::Command show all
Defined in:
lib/convenient_service/utils/array/find_last.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Support::Command

[], call

Constructor Details

#initialize(array, &block) ⇒ void

Parameters:



24
25
26
27
# File 'lib/convenient_service/utils/array/find_last.rb', line 24

def initialize(array, &block)
  @array = array
  @block = block
end

Instance Attribute Details

#arrayObject (readonly)

Returns the value of attribute array.



11
12
13
# File 'lib/convenient_service/utils/array/find_last.rb', line 11

def array
  @array
end

#blockObject (readonly)

Returns the value of attribute block.



17
18
19
# File 'lib/convenient_service/utils/array/find_last.rb', line 17

def block
  @block
end

Instance Method Details

#callObject

Returns Can be any type.

Returns:

  • (Object)

    Can be any type.



32
33
34
# File 'lib/convenient_service/utils/array/find_last.rb', line 32

def call
  array.reverse.find(&block)
end