Class: MoneyHeuristics::SearchTree

Inherits:
Object
  • Object
show all
Defined in:
lib/money-heuristics/search_tree.rb

Instance Method Summary collapse

Constructor Details

#initialize(currency_data) ⇒ SearchTree

Returns a new instance of SearchTree.



3
4
5
# File 'lib/money-heuristics/search_tree.rb', line 3

def initialize(currency_data)
  @currency_data = currency_data
end

Instance Method Details

#buildObject

Build a search tree from the currency database



8
9
10
11
12
13
14
# File 'lib/money-heuristics/search_tree.rb', line 8

def build
  {
    by_symbol:   currencies_by_symbol,
    by_iso_code: currencies_by_iso_code,
    by_name:     currencies_by_name
  }
end