Module: Draper

Defined in:
lib/draper/factory.rb,
lib/draper/finders.rb,
lib/draper/railtie.rb,
lib/draper/version.rb,
lib/draper/decorator.rb,
lib/draper/test_case.rb,
lib/draper/delegation.rb,
lib/draper/undecorate.rb,
lib/draper/decoratable.rb,
lib/draper/helper_proxy.rb,
lib/draper/lazy_helpers.rb,
lib/draper/view_context.rb,
lib/draper/view_helpers.rb,
lib/draper/configuration.rb,
lib/draper/decorates_assigned.rb,
lib/draper/test/devise_helper.rb,
lib/draper/automatic_delegation.rb,
lib/draper/collection_decorator.rb,
lib/draper/decoratable/equality.rb,
lib/draper/decorated_association.rb,
lib/draper/compatibility/api_only.rb,
lib/draper/test/rspec_integration.rb,
lib/draper/compatibility/global_id.rb,
lib/draper/view_context/build_strategy.rb

Defined Under Namespace

Modules: AutomaticDelegation, Compatibility, Configuration, Decoratable, DecoratesAssigned, DecoratorExampleGroup, Delegation, DeviseHelper, Finders, HelperSupport, LazyHelpers, ViewContext, ViewHelpers Classes: CollectionDecorator, Decorator, Factory, HelperProxy, Railtie, TestCase

Constant Summary

VERSION =
'3.0.1'

Class Method Summary collapse

Class Method Details

.undecorate(object) ⇒ Object



2
3
4
5
6
7
8
# File 'lib/draper/undecorate.rb', line 2

def self.undecorate(object)
  if object.respond_to?(:decorated?) && object.decorated?
    object.object
  else
    object
  end
end

.undecorate_chain(object) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/draper/undecorate.rb', line 10

def self.undecorate_chain(object)
  if object.respond_to?(:decorated?) && object.decorated?
    undecorate_chain(object.object)
  else
    object
  end
end