Sha256: 4be8f60fcec8fc2e4c6d55379a5e38826502cc6e43f5b1f3ee2592085338a662

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

module Himekaminize
  class TaskList
    class << self
       # @return [Array<Himekaminize::Filters::BaseFilter>]
       def filters
         @filters ||= [
           ::Himekaminize::Filters::TaskFilter.new
         ]
       end
    end

    # @param markdown [String]
    def initialize(markdown)
      @markdown = markdown
      to_lines
    end

    # @todo
    # @param markdown [Array]
    def to_a
      self.class.filters.inject(@lines) do |result, filter|
        filter.call(result)
      end
    end

    private

    def to_lines
      @lines = @markdown.lines
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
himekaminize-0.0.1 lib/himekaminize/task_list.rb