Class: Jat::Plugins::JsonApiPreloads::Preloads

Inherits:
Object
  • Object
show all
Defined in:
lib/jat/plugins/json_api/plugins/json_api_preloads/lib/preloads.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_map) ⇒ Preloads

Returns a new instance of Preloads.



15
16
17
18
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/lib/preloads.rb', line 15

def initialize(current_map)
  @used = Set.new
  @current_map = current_map
end

Class Method Details

.call(jat) ⇒ Object



10
11
12
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/lib/preloads.rb', line 10

def call(jat)
  new(jat.map).for(jat.class)
end

Instance Method Details

#for(jat_class) ⇒ Object



20
21
22
23
24
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/lib/preloads.rb', line 20

def for(jat_class)
  result = {}
  append(result, jat_class)
  result
end