Class: RTesseract::Configuration
- Inherits:
-
Object
- Object
- RTesseract::Configuration
- Defined in:
- lib/rtesseract/configuration.rb
Overview
Configuration class
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#lang ⇒ Object
Returns the value of attribute lang.
-
#oem ⇒ Object
Returns the value of attribute oem.
-
#options_cmd ⇒ Object
Returns the value of attribute options_cmd.
-
#processor ⇒ Object
Returns the value of attribute processor.
-
#psm ⇒ Object
Returns the value of attribute psm.
-
#tessdata_dir ⇒ Object
Returns the value of attribute tessdata_dir.
-
#user_patterns ⇒ Object
Returns the value of attribute user_patterns.
-
#user_words ⇒ Object
Returns the value of attribute user_words.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#load_options(options, names = []) ⇒ Object
Return the values of options.
-
#option(options, name, default = nil) ⇒ Object
Set value of option.
-
#parent ⇒ Object
Global configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 |
# File 'lib/rtesseract/configuration.rb', line 19 def initialize @processor = 'rmagick' end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def command @command end |
#debug ⇒ Object
Returns the value of attribute debug.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def debug @debug end |
#lang ⇒ Object
Returns the value of attribute lang.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def lang @lang end |
#oem ⇒ Object
Returns the value of attribute oem.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def oem @oem end |
#options_cmd ⇒ Object
Returns the value of attribute options_cmd.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def end |
#processor ⇒ Object
Returns the value of attribute processor.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def processor @processor end |
#psm ⇒ Object
Returns the value of attribute psm.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def psm @psm end |
#tessdata_dir ⇒ Object
Returns the value of attribute tessdata_dir.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def tessdata_dir @tessdata_dir end |
#user_patterns ⇒ Object
Returns the value of attribute user_patterns.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def user_patterns @user_patterns end |
#user_words ⇒ Object
Returns the value of attribute user_words.
17 18 19 |
# File 'lib/rtesseract/configuration.rb', line 17 def user_words @user_words end |
Instance Method Details
#load_options(options, names = []) ⇒ Object
Return the values of options
34 35 36 |
# File 'lib/rtesseract/configuration.rb', line 34 def (, names = []) names.each { |name| option(, name, nil) } end |
#option(options, name, default = nil) ⇒ Object
Set value of option
29 30 31 |
# File 'lib/rtesseract/configuration.rb', line 29 def option(, name, default = nil) self.instance_variable_set("@#{name}", .option(name, parent.send(name)) || default) end |
#parent ⇒ Object
Global configuration
24 25 26 |
# File 'lib/rtesseract/configuration.rb', line 24 def parent @parent ||= RTesseract.configuration || RTesseract::Configuration.new end |