Sha256: 33358693a0d7ad2c5d15d445abc342e6cf43338b8d09e64dcba7cfe4bf27f71a

Contents?: true

Size: 375 Bytes

Versions: 7

Compression:

Stored size: 375 Bytes

Contents

# encoding: utf-8

module Dusen
  class Token

    attr_reader :field, :value, :exclude

    def initialize(options)
      @value = options.fetch(:value)
      @exclude = options.fetch(:exclude)
      @field = options.fetch(:field).to_s
    end

    def to_s
      value
    end

    def text?
      field == 'text'
    end

    def exclude?
      exclude
    end

  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
dusen-0.6.1 lib/dusen/token.rb
dusen-0.6.0 lib/dusen/token.rb
dusen-0.5.3 lib/dusen/token.rb
dusen-0.5.2 lib/dusen/token.rb
dusen-0.5.1 lib/dusen/token.rb
dusen-0.5 lib/dusen/token.rb
dusen-0.4.11 lib/dusen/token.rb