Module: SimpleExposure::Core::ClassMethods

Defined in:
lib/simple_exposure/core.rb

Instance Method Summary collapse

Instance Method Details

#_exposure_extensionsObject



50
51
52
# File 'lib/simple_exposure/core.rb', line 50

def _exposure_extensions
  @_exposure_extensions ||= HashWithIndifferentAccess.new([])
end

#expose(*attributes, &block) ⇒ Object



40
41
42
43
44
45
46
47
48
# File 'lib/simple_exposure/core.rb', line 40

def expose(*attributes, &block)
  options = attributes.extract_options!

  extensions = options.fetch(:extend, nil)
  extensions = Array(extensions)

  _define_exposure_accessors(attributes, &block)
  _define_exposure_extensions(attributes, extensions)
end