Class: Dictionary
- Inherits:
-
Object
- Object
- Dictionary
- Defined in:
- lib/learn-japanese/dictionary.rb
Instance Attribute Summary collapse
-
#words ⇒ Object
readonly
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize ⇒ Dictionary
constructor
A new instance of Dictionary.
Constructor Details
#initialize ⇒ Dictionary
Returns a new instance of Dictionary.
7 8 9 10 |
# File 'lib/learn-japanese/dictionary.rb', line 7 def initialize() filename = File.join(File.dirname(__FILE__), 'data', 'words.yaml') @words = YAML.load(File.read(filename)) end |
Instance Attribute Details
#words ⇒ Object (readonly)
Returns the value of attribute words.
5 6 7 |
# File 'lib/learn-japanese/dictionary.rb', line 5 def words @words end |