Sha256: 35348e5fa0e581b9e45ee938633ab32d14b839631ee99f193577e07b0fc3f97a
Contents?: true
Size: 801 Bytes
Versions: 5
Compression:
Stored size: 801 Bytes
Contents
# frozen_string_literal: true module Rika # Encapsulates all results of parsing a document. ParseResult = Struct.new( :content, :metadata, :metadata_java, :content_type, :language, :input_type, :data_source, :max_content_length, keyword_init: true ) do # Support using 'text' instead of 'content'; this often makes more sense. alias_method :text, :content # @return [Boolean] true if, and only if, input is a file def file? input_type == :file end # @return [Boolean] true if, and only if, input is HTTP def http? input_type == :http end # @return [Hash] content and metadata of ParseResult instance as hash def content_and_metadata_hash { content: content, metadata: metadata } end end end
Version data entries
5 entries across 5 versions & 1 rubygems