Sha256: 500ae0a8c7334b5da2719db66fa34d9b8bfda7bb8deb52109d8c28c99ff3d6ae

Contents?: true

Size: 434 Bytes

Versions: 1

Compression:

Stored size: 434 Bytes

Contents

module Himekaminize
  module Filters
    class TaskFilter < BaseFilter
      # @note Override
      # @param array [Array]
      # @return [Array]
      def call(array)
        array
          .select { |line| line.is_a?(String) && line =~ /\A\s*(#{Himekaminize::Task::INCOMPLETE_PATTERN}|#{Himekaminize::Task::COMPLETE_PATTERN})/ }
          .map.with_index {|n, idx| Himekaminize::Task.new(n, idx + 1)}
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
himekaminize-0.0.1 lib/himekaminize/filters/task_filter.rb