Class: Dictionaries::AskEnglishWord

Inherits:
AskWordFromDictionary show all
Defined in:
lib/dictionaries/ask_english_word.rb

Constant Summary collapse

DEFAULT_DELAY =

Next, define the default delay.

_.strip.to_f
THIS_FILE =
#

AskEnglishWord::THIS_FILE

#
THIS_FILE_HERE = __FILE__.to_s

Constants inherited from AskWordFromDictionary

Dictionaries::AskWordFromDictionary::NAMESPACE, Dictionaries::AskWordFromDictionary::USE_THIS_EDITOR

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from AskWordFromDictionary

#available_keys?, #be_verbose?, #brown, #build_url_www_string, #consider_opening_browser_page, #dataset?, #delay?, #do_ask_the_question, #feedback_delay, #feedback_help_options, #feedback_statistics, #feedback_total_amount_of_keys, #feedback_url, #feedback_yaml_file, #find_all_matches_for, #find_this_word_in_yaml_file, #generate_tab_completion, #green, #is_included?, #load_dataset, #load_the_english_file, #main_file?, #notify_the_user_that_we_will_next_open_this_file, #on_roebe?, #open_this_file_here, #open_yaml_file_in_main_editor, #opnn, #register_sigint, #reset, #result?, #return_random_word, #rev, #reveal_the_answer, #run, #sanitize_answer, #sanitize_dataset, #save_file, #save_last_question_asked, #save_line_number, #sdir, #search_for?, #set_delay, #set_last_word_solved, #set_search_for_this_word, #set_use_this_file, #set_xorg_buffer, #sfancy, #sfile, #show_delay_string, #show_every_word, #show_help, #simp, #store_last_question_asked_where?, #translate, #use_this_file?, #words?

Methods inherited from Base

#commandline_arguments?, #first_argument?, #opne, #reset, #rev, #set_commandline_arguments, #sfancy

Constructor Details

#initialize(commandline_arguments = ARGV) ⇒ AskEnglishWord

#

initialize

#


67
68
69
70
71
# File 'lib/dictionaries/ask_english_word.rb', line 67

def initialize(
    commandline_arguments = ARGV
  )
  super(commandline_arguments, self.class.main_file?)
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

Dictionaries::AskEnglishWord[]

#


104
105
106
# File 'lib/dictionaries/ask_english_word.rb', line 104

def self.[](i = ARGV)
  new(i)
end

.dataset?Boolean

#

Dictionaries::AskEnglishWord.dataset?

Note that this method will load the dataset from the main file anew whenever you invoke it.

#

Returns:

  • (Boolean)


86
87
88
# File 'lib/dictionaries/ask_english_word.rb', line 86

def self.dataset?
  YAML.load_file(self.main_file?)
end

.main_file?Boolean

#

Dictionaries::AskEnglishWord.main_file?

#

Returns:

  • (Boolean)


76
77
78
# File 'lib/dictionaries/ask_english_word.rb', line 76

def self.main_file?
  Dictionaries.main_file?
end

.n_entries?Boolean

#

Dictionaries::AskEnglishWord.n_entries?

Feedback how many entries are registered.

#

Returns:

  • (Boolean)


95
96
97
98
99
# File 'lib/dictionaries/ask_english_word.rb', line 95

def self.n_entries?
  _ = dataset?
  n_entries = _.size
  return n_entries
end