Module: Jat::Plugins::JsonApiPreloads

Defined in:
lib/jat/plugins/json_api/plugins/json_api_preloads/lib/preloads.rb,
lib/jat/plugins/json_api/plugins/json_api_preloads/json_api_preloads.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: Preloads

Class Method Summary collapse

Class Method Details

.before_load(jat_class, **opts) ⇒ Object

Raises:



12
13
14
15
16
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/json_api_preloads.rb', line 12

def self.before_load(jat_class, **opts)
  raise Error, "Please load :json_api plugin first" unless jat_class.plugin_used?(:json_api)

  jat_class.plugin :base_preloads, **opts
end

.load(jat_class, **_opts) ⇒ Object



18
19
20
21
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/json_api_preloads.rb', line 18

def self.load(jat_class, **_opts)
  jat_class.extend(ClassMethods)
  jat_class.include(InstanceMethods)
end

.plugin_nameObject



8
9
10
# File 'lib/jat/plugins/json_api/plugins/json_api_preloads/json_api_preloads.rb', line 8

def self.plugin_name
  :json_api_preloads
end