Module: Serega::SeregaPlugins::Preloads::AttributeInstanceMethods

Defined in:
lib/serega/plugins/preloads/preloads.rb

Overview

Serega::SeregaAttribute additional/patched instance methods

Instance Method Summary collapse

Instance Method Details

#hideBoolean?

Patch for original hide method

Marks attribute hidden if auto_hide_attribute_with_preloads option was set and attribute has preloads

Returns:

  • (Boolean, nil)

    if attribute is hidden

See Also:



224
225
226
227
228
229
# File 'lib/serega/plugins/preloads/preloads.rb', line 224

def hide
  res = super
  return res unless res.nil?

  auto_hide_attribute_with_preloads? || nil
end

#preloadsHash?

Returns formatted preloads of current attribute.

Returns:

  • (Hash, nil)

    formatted preloads of current attribute



203
204
205
206
207
# File 'lib/serega/plugins/preloads/preloads.rb', line 203

def preloads
  return @preloads if defined?(@preloads)

  @preloads = get_preloads
end

#preloads_pathArray

Returns formatted preloads_path of current attribute.

Returns:

  • (Array)

    formatted preloads_path of current attribute



210
211
212
213
214
# File 'lib/serega/plugins/preloads/preloads.rb', line 210

def preloads_path
  return @preloads_path if defined?(@preloads_path)

  @preloads_path = get_preloads_path
end