Sha256: b231463e8710952ef17afc4d7de4aa17abbfe02ed785c64278048df23c86d086

Contents?: true

Size: 712 Bytes

Versions: 14

Compression:

Stored size: 712 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Utils
    module Array
      class FindLast < Support::Command
        ##
        # @!attribute [r] array
        #   @return [Array]
        #
        attr_reader :array

        ##
        # @!attribute [r] block
        #   @return [Proc]
        #
        attr_reader :block

        ##
        # @param array [Array]
        # @param block [Proc]
        # @return [void]
        #
        def initialize(array, &block)
          @array = array
          @block = block
        end

        ##
        # @return [Object] Can be any type.
        #
        def call
          array.reverse.find(&block)
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
convenient_service-0.11.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.10.1 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.10.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.9.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.8.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.7.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.6.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.5.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.4.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.3.1 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.3.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.2.1 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.2.0 lib/convenient_service/utils/array/find_last.rb
convenient_service-0.1.0 lib/convenient_service/utils/array/find_last.rb