Sha256: 30b7443350b4a94b8229549246a58b7ecafec65756c7f7493392c1014426e6ba

Contents?: true

Size: 327 Bytes

Versions: 2

Compression:

Stored size: 327 Bytes

Contents

# frozen_string_literal: true

module Farseer
  class Word
    include MapFactory

    def initialize(word)
      @word = word
      freeze
    end

    def parse(input)
      case
      when input.start_with?(@word) then Maybe.return(Result.new(@word, input[@word.length..]))
      else Maybe.none
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
farseer-0.9.0 lib/farseer/word.rb
farseer-0.8.0 lib/farseer/word.rb