Sha256: fd28898a0bffa142119a7a2f9173f0390996f874d0d84184e9da6c71cc756120

Contents?: true

Size: 500 Bytes

Versions: 54

Compression:

Stored size: 500 Bytes

Contents

# frozen_string_literal: true

require "forwardable"

module Pennyworth
  module Presenters
    # Renders text into a compatible format for use in Alfred script filters.
    class Text
      extend Forwardable

      delegate %i[id content] => :record

      def initialize record, inflector: Inflector.new
        @record = record
        @inflector = inflector
      end

      def label = inflector.call(record.content.to_s)

      private

      attr_reader :record, :inflector
    end
  end
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
pennyworth-15.0.0 lib/pennyworth/presenters/text.rb
pennyworth-14.3.0 lib/pennyworth/presenters/text.rb
pennyworth-14.2.1 lib/pennyworth/presenters/text.rb
pennyworth-14.2.0 lib/pennyworth/presenters/text.rb
pennyworth-14.1.2 lib/pennyworth/presenters/text.rb
pennyworth-14.1.1 lib/pennyworth/presenters/text.rb
pennyworth-14.1.0 lib/pennyworth/presenters/text.rb
pennyworth-14.0.0 lib/pennyworth/presenters/text.rb
pennyworth-13.8.0 lib/pennyworth/presenters/text.rb
pennyworth-13.7.0 lib/pennyworth/presenters/text.rb
pennyworth-13.6.0 lib/pennyworth/presenters/text.rb
pennyworth-13.5.0 lib/pennyworth/presenters/text.rb
pennyworth-13.4.0 lib/pennyworth/presenters/text.rb
pennyworth-13.3.0 lib/pennyworth/presenters/text.rb
pennyworth-13.2.0 lib/pennyworth/presenters/text.rb
pennyworth-13.1.0 lib/pennyworth/presenters/text.rb
pennyworth-13.0.1 lib/pennyworth/presenters/text.rb
pennyworth-13.0.0 lib/pennyworth/presenters/text.rb
pennyworth-12.3.1 lib/pennyworth/presenters/text.rb
pennyworth-12.3.0 lib/pennyworth/presenters/text.rb