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.
-
#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
- #option(options, name, default = nil) ⇒ Object
- #parent ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 |
# File 'lib/rtesseract/configuration.rb', line 15 def initialize @processor = 'rmagick' end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def command @command end |
#debug ⇒ Object
Returns the value of attribute debug.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def debug @debug end |
#lang ⇒ Object
Returns the value of attribute lang.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def lang @lang end |
#options_cmd ⇒ Object
Returns the value of attribute options_cmd.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def @options_cmd end |
#processor ⇒ Object
Returns the value of attribute processor.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def processor @processor end |
#psm ⇒ Object
Returns the value of attribute psm.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def psm @psm end |
#tessdata_dir ⇒ Object
Returns the value of attribute tessdata_dir.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def tessdata_dir @tessdata_dir end |
#user_patterns ⇒ Object
Returns the value of attribute user_patterns.
13 14 15 |
# File 'lib/rtesseract/configuration.rb', line 13 def user_patterns @user_patterns end |
#user_words ⇒ Object
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 (, names = []) names.each{ |name| option(, name, nil) } end |
#option(options, name, default = nil) ⇒ Object
23 24 25 |
# File 'lib/rtesseract/configuration.rb', line 23 def option(, name, default = nil) self.instance_variable_set("@#{name}", .option(name, parent.send(name)) || default) end |
#parent ⇒ Object
19 20 21 |
# File 'lib/rtesseract/configuration.rb', line 19 def parent @parent ||= RTesseract.configuration || RTesseract::Configuration.new end |