Sha256: 5e7b2954ec685de7c400d93437db3b7d17f88fb56dee518e2a11806e43c77932

Contents?: true

Size: 474 Bytes

Versions: 3

Compression:

Stored size: 474 Bytes

Contents

# frozen_string_literal: true

module Pennyworth
  module CLI
    module Actions
      # Handles the text action.
      class Text
        include Pennyworth::Import[:logger]

        def initialize(processor: Processor.for_text, **)
          super(**)
          @processor = processor
        end

        def call(content) = processor.call(content).to_json.then { |json| logger.info { json } }

        private

        attr_reader :processor
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
pennyworth-14.2.1 lib/pennyworth/cli/actions/text.rb
pennyworth-14.2.0 lib/pennyworth/cli/actions/text.rb
pennyworth-14.1.2 lib/pennyworth/cli/actions/text.rb