Class: ConvenientService::Utils::Array::FindYield Private
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Array::FindYield
- Defined in:
- lib/convenient_service/utils/array/find_yield.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #array ⇒ Object readonly private
- #block ⇒ Object readonly private
Instance Method Summary collapse
-
#call ⇒ Object?
private
Can be any type.
- #initialize(array, &block) ⇒ void constructor private
Methods inherited from Support::Command
Constructor Details
#initialize(array, &block) ⇒ void
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
77 78 79 80 |
# File 'lib/convenient_service/utils/array/find_yield.rb', line 77 def initialize(array, &block) @array = array @block = block end |
Instance Attribute Details
#array ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
64 65 66 |
# File 'lib/convenient_service/utils/array/find_yield.rb', line 64 def array @array end |
#block ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
70 71 72 |
# File 'lib/convenient_service/utils/array/find_yield.rb', line 70 def block @block end |
Instance Method Details
#call ⇒ Object?
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns Can be any type.
86 87 88 89 90 91 92 93 94 |
# File 'lib/convenient_service/utils/array/find_yield.rb', line 86 def call array.each do |item| block_value = block.call(item) return block_value if block_value end nil end |