Class: JDict::Configuration

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

#debugObject

Returns the value of attribute debug.



5
6
7
# File 'lib/configuration.rb', line 5

def debug
  @debug
end

#dictionary_pathObject

Returns the value of attribute dictionary_path.



5
6
7
# File 'lib/configuration.rb', line 5

def dictionary_path
  @dictionary_path
end

#jmdict_rsync_urlObject

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_urlObject

Returns the value of attribute jmdict_url.



5
6
7
# File 'lib/configuration.rb', line 5

def jmdict_url
  @jmdict_url
end

#languageObject

Returns the value of attribute language.



5
6
7
# File 'lib/configuration.rb', line 5

def language
  @language
end

#num_resultsObject

Returns the value of attribute num_results.



5
6
7
# File 'lib/configuration.rb', line 5

def num_results
  @num_results
end