Class: ActiveMigration::Dictionary

Inherits:
Object
  • Object
show all
Defined in:
lib/active_migration/dictionary.rb

Instance Method Summary collapse

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