Module: ContextExposer::Integrations::WithDecentExposure::ClassMethods

Defined in:
lib/context_exposer/integrations/with_draper.rb,
lib/context_exposer/integrations/with_decent_exposure.rb

Instance Method Summary collapse

Instance Method Details

#context_expose_assigned(options = {}) ⇒ Object Also known as: expose_assigned

expose all exposures exposed by decent_exposure to context



13
14
15
16
17
18
19
20
21
# File 'lib/context_exposer/integrations/with_draper.rb', line 13

def context_expose_assigned options = {}
  expose_keys = _decorates_assigned_list

  _exposure_filter(expose_keys, options).each do |exposure|
    exposed exposure do
      send(exposure)
    end
  end
end

#context_expose_decently(options = {}) ⇒ Object Also known as: expose_decently

expose all exposures exposed by decent_exposure to context



7
8
9
10
11
12
13
14
15
# File 'lib/context_exposer/integrations/with_decent_exposure.rb', line 7

def context_expose_decently options = {}
  expose_keys = _exposures.keys

  _exposure_filter(expose_keys, options).each do |exposure|
    exposed exposure do
      send(exposure)
    end
  end
end

#decorates_assigned(*variables) ⇒ Object



6
7
8
9
10
# File 'lib/context_exposer/integrations/with_draper.rb', line 6

def decorates_assigned(*variables)
  super
  variables.extract_options!
  @decorates_assigned_list = variables 
end