Class: ActiveMigration::Dictionary
- Inherits:
-
Object
- Object
- ActiveMigration::Dictionary
- Defined in:
- lib/active_migration/dictionary.rb
Instance Method Summary collapse
- #find(term) ⇒ Object
-
#initialize(url) ⇒ Dictionary
constructor
A new instance of Dictionary.
Constructor Details
#initialize(url) ⇒ Dictionary
Returns a new instance of Dictionary.
5 6 7 |
# File 'lib/active_migration/dictionary.rb', line 5 def initialize(url) @dictionary = YAML::load(File.open(url)) end |
Instance Method Details
#find(term) ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/active_migration/dictionary.rb', line 9 def find(term) if @dictionary.include? term.to_s @dictionary[term.to_s] else term.to_s end end |