Class: JDict::Configuration
- Inherits:
-
Object
- Object
- JDict::Configuration
- Defined in:
- lib/configuration.rb
Constant Summary collapse
- BASE_PATH =
ENV["HOME"]
- DICT_PATH =
File.join(BASE_PATH, '.dicts')
- JMDICT_URL =
"ftp://ftp.monash.edu.au/pub/nihongo/JMdict.gz"- JMDICT_RSYNC_URL =
"rsync://ftp.monash.edu.au/nihongo/JMdict"
Instance Attribute Summary collapse
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#dictionary_path ⇒ Object
Returns the value of attribute dictionary_path.
-
#jmdict_rsync_url ⇒ Object
Returns the value of attribute jmdict_rsync_url.
-
#jmdict_url ⇒ Object
Returns the value of attribute jmdict_url.
-
#language ⇒ Object
Returns the value of attribute language.
-
#num_results ⇒ Object
Returns the value of attribute num_results.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/configuration.rb', line 14 def initialize # directory containing dictionary files @dictionary_path = DICT_PATH # maximum results to return from searching @num_results = 50 # language to return search results in @language = JDict::JMDictConstants::Languages::ENGLISH # limit number of entries indexed, rebuild index on instantiation @debug = false # url to retrieve JMDict from @jmdict_url = JMDICT_URL # url to rsync JMDict from @jmdict_rsync_url = JMDICT_RSYNC_URL end |
Instance Attribute Details
#debug ⇒ Object
Returns the value of attribute debug.
5 6 7 |
# File 'lib/configuration.rb', line 5 def debug @debug end |
#dictionary_path ⇒ Object
Returns the value of attribute dictionary_path.
5 6 7 |
# File 'lib/configuration.rb', line 5 def dictionary_path @dictionary_path end |
#jmdict_rsync_url ⇒ Object
Returns the value of attribute jmdict_rsync_url.
5 6 7 |
# File 'lib/configuration.rb', line 5 def jmdict_rsync_url @jmdict_rsync_url end |
#jmdict_url ⇒ Object
Returns the value of attribute jmdict_url.
5 6 7 |
# File 'lib/configuration.rb', line 5 def jmdict_url @jmdict_url end |
#language ⇒ Object
Returns the value of attribute language.
5 6 7 |
# File 'lib/configuration.rb', line 5 def language @language end |
#num_results ⇒ Object
Returns the value of attribute num_results.
5 6 7 |
# File 'lib/configuration.rb', line 5 def num_results @num_results end |