Class: Baan::Cache
- Inherits:
-
Object
- Object
- Baan::Cache
- Defined in:
- lib/baan/cache.rb
Instance Attribute Summary collapse
-
#parser ⇒ Object
readonly
Returns the value of attribute parser.
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(parser: Parser.new) ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
Instance Attribute Details
#parser ⇒ Object (readonly)
Returns the value of attribute parser.
3 4 5 |
# File 'lib/baan/cache.rb', line 3 def parser @parser end |
Instance Method Details
#data ⇒ Object
9 10 11 12 13 14 15 |
# File 'lib/baan/cache.rb', line 9 def data @data ||= begin dataset.each_with_object(Hash.new { |h, k| h[k] = {} }) do |(key, dataset), result| dataset.each { result[key][it.code] = it } end end end |