Sha256: 867828e339b43be465f78d5789e84fa5e7f3da79909f27c6c65392b2a7852074
Contents?: true
Size: 917 Bytes
Versions: 1
Compression:
Stored size: 917 Bytes
Contents
module Fable class ListDefinitionsOrigin attr_accessor :_lists, :all_unambiguous_list_value_cache def lists self._lists.map{|k,v| v} end def find_list(name) self._lists[name] end def initialize(lists) self._lists = {} self.all_unambiguous_list_value_cache = {} lists.each do |list| self._lists[list.name] = list list.items.each do |item, int_value| list_value = ListValue.new(item, int_value) # May be ambiguous, but compiler should've caught that, # so we may be doing some replacement here, but that's okay self.all_unambiguous_list_value_cache[item.item_name] = list_value self.all_unambiguous_list_value_cache[item.full_name] = list_value end end end def find_single_item_list_with_name(name) return all_unambiguous_list_value_cache[name] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
fable-0.5.0 | lib/fable/list_definitions_origin.rb |