Class: RTesseract::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/rtesseract/configuration.rb

Overview

Configuration class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



15
16
17
# File 'lib/rtesseract/configuration.rb', line 15

def initialize
  @processor = 'rmagick'
end

Instance Attribute Details

#commandObject

Returns the value of attribute command.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def command
  @command
end

#debugObject

Returns the value of attribute debug.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def debug
  @debug
end

#langObject

Returns the value of attribute lang.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def lang
  @lang
end

#options_cmdObject

Returns the value of attribute options_cmd.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def options_cmd
  @options_cmd
end

#processorObject

Returns the value of attribute processor.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def processor
  @processor
end

#psmObject

Returns the value of attribute psm.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def psm
  @psm
end

#tessdata_dirObject

Returns the value of attribute tessdata_dir.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def tessdata_dir
  @tessdata_dir
end

#user_patternsObject

Returns the value of attribute user_patterns.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def user_patterns
  @user_patterns
end

#user_wordsObject

Returns the value of attribute user_words.



13
14
15
# File 'lib/rtesseract/configuration.rb', line 13

def user_words
  @user_words
end

Instance Method Details

#load_options(options, names = []) ⇒ Object



27
28
29
# File 'lib/rtesseract/configuration.rb', line 27

def load_options(options, names = [])
  names.each{ |name| option(options, name, nil) }
end

#option(options, name, default = nil) ⇒ Object



23
24
25
# File 'lib/rtesseract/configuration.rb', line 23

def option(options, name, default = nil)
  self.instance_variable_set("@#{name}", options.option(name, parent.send(name)) || default)
end

#parentObject



19
20
21
# File 'lib/rtesseract/configuration.rb', line 19

def parent
  @parent ||= RTesseract.configuration || RTesseract::Configuration.new
end