class Rubipara::AA

Attributes

aa_lines[R]
max_length[R]
word[R]

Public Class Methods

new(file_name, word: nil, max_length: 20) click to toggle source
# File lib/rubipara/aa.rb, line 6
def initialize(file_name, word: nil, max_length: 20)
  @aa_lines = get_aa_lines(file_name.to_s)
  @word = word
  @max_length = max_length
end

Private Instance Methods

get_aa_lines(file_name) click to toggle source

return an array whose elements contain each line in AA Ex. arr contains the first line of AA, arr contains the second line of AA.

# File lib/rubipara/aa.rb, line 16
def get_aa_lines(file_name)
  File.open("#{File.dirname(__FILE__)}/../../config/aa/#{file_name}.txt") {|f| f.readlines }
end