Class: Mindee::WorkflowOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/mindee/client.rb

Overview

Class for configuration options in workflow executions.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params: {}) ⇒ WorkflowOptions

Returns a new instance of WorkflowOptions.



75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/mindee/client.rb', line 75

def initialize(params: {})
  params = params.transform_keys(&:to_sym)
  @document_alias = params.fetch(:document_alias, nil)
  @priority = params.fetch(:priority, nil)
  @full_text = params.fetch(:full_text, false)
  @public_url = params.fetch(:public_url, nil)
  @rag = params.fetch(:rag, nil)
  raw_page_options = params.fetch(:page_options, nil)
  raw_page_options = PageOptions.new(params: raw_page_options) unless raw_page_options.is_a?(PageOptions)
  @page_options = raw_page_options
  @close_file = params.fetch(:close_file, true)
end

Instance Attribute Details

#close_fileObject

Returns the value of attribute close_file.



73
74
75
# File 'lib/mindee/client.rb', line 73

def close_file
  @close_file
end

#document_aliasObject

Alias to give to the document.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mindee/client.rb', line 72

class WorkflowOptions
  attr_accessor :document_alias, :priority, :full_text, :public_url, :page_options, :rag, :close_file

  def initialize(params: {})
    params = params.transform_keys(&:to_sym)
    @document_alias = params.fetch(:document_alias, nil)
    @priority = params.fetch(:priority, nil)
    @full_text = params.fetch(:full_text, false)
    @public_url = params.fetch(:public_url, nil)
    @rag = params.fetch(:rag, nil)
    raw_page_options = params.fetch(:page_options, nil)
    raw_page_options = PageOptions.new(params: raw_page_options) unless raw_page_options.is_a?(PageOptions)
    @page_options = raw_page_options
    @close_file = params.fetch(:close_file, true)
  end
end

#full_textObject

Returns the value of attribute full_text.



73
74
75
# File 'lib/mindee/client.rb', line 73

def full_text
  @full_text
end

#page_optionsObject

Returns the value of attribute page_options.



73
74
75
# File 'lib/mindee/client.rb', line 73

def page_options
  @page_options
end

#priorityObject

Returns the value of attribute priority.



73
74
75
# File 'lib/mindee/client.rb', line 73

def priority
  @priority
end

#public_urlObject

A unique, encrypted URL for accessing the document validation interface without requiring authentication.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
# File 'lib/mindee/client.rb', line 72

class WorkflowOptions
  attr_accessor :document_alias, :priority, :full_text, :public_url, :page_options, :rag, :close_file

  def initialize(params: {})
    params = params.transform_keys(&:to_sym)
    @document_alias = params.fetch(:document_alias, nil)
    @priority = params.fetch(:priority, nil)
    @full_text = params.fetch(:full_text, false)
    @public_url = params.fetch(:public_url, nil)
    @rag = params.fetch(:rag, nil)
    raw_page_options = params.fetch(:page_options, nil)
    raw_page_options = PageOptions.new(params: raw_page_options) unless raw_page_options.is_a?(PageOptions)
    @page_options = raw_page_options
    @close_file = params.fetch(:close_file, true)
  end
end

#ragObject

Returns the value of attribute rag.



73
74
75
# File 'lib/mindee/client.rb', line 73

def rag
  @rag
end