diff --git a/lib/draper/decoratable.rb b/lib/draper/decoratable.rb index 6f16f7d..5a3aee3 100644 --- a/lib/draper/decoratable.rb +++ b/lib/draper/decoratable.rb @@ -48,7 +48,6 @@ module Draper end module ClassMethods - # Decorates a collection of objects. Used at the end of a scope chain. # # @example diff --git a/lib/draper/decorated_association.rb b/lib/draper/decorated_association.rb index 7bdbb76..6bba855 100644 --- a/lib/draper/decorated_association.rb +++ b/lib/draper/decorated_association.rb @@ -1,7 +1,6 @@ module Draper # @private class DecoratedAssociation - def initialize(owner, association, options) options.assert_valid_keys(:with, :scope, :context) @@ -30,6 +29,5 @@ module Draper @decorated = factory.decorate(associated, context_args: owner.context) end - end end diff --git a/lib/draper/finders.rb b/lib/draper/finders.rb index b0fe0cc..3cb4648 100644 --- a/lib/draper/finders.rb +++ b/lib/draper/finders.rb @@ -3,7 +3,6 @@ module Draper # do not have to extend this module directly; it is extended by # {Decorator.decorates_finders}. module Finders - def find(id, options = {}) decorate(object_class.find(id), options) end diff --git a/lib/draper/helper_proxy.rb b/lib/draper/helper_proxy.rb index dd590be..8645a13 100644 --- a/lib/draper/helper_proxy.rb +++ b/lib/draper/helper_proxy.rb @@ -2,7 +2,6 @@ module Draper # Provides access to helper methods - both Rails built-in helpers, and those # defined in your application. class HelperProxy - # @overload initialize(view_context) def initialize(view_context) @view_context = view_context diff --git a/lib/draper/lazy_helpers.rb b/lib/draper/lazy_helpers.rb index 2e8d9a0..c25761a 100644 --- a/lib/draper/lazy_helpers.rb +++ b/lib/draper/lazy_helpers.rb @@ -3,13 +3,11 @@ module Draper # so that you can stop typing `h.` everywhere, at the cost of mixing in a # bazillion methods. module LazyHelpers - # Sends missing methods to the {HelperProxy}. def method_missing(method, *args, &block) helpers.send(method, *args, &block) rescue NoMethodError super end - end end diff --git a/lib/draper/undecorate.rb b/lib/draper/undecorate.rb index 5381065..42ada29 100644 --- a/lib/draper/undecorate.rb +++ b/lib/draper/undecorate.rb @@ -6,7 +6,7 @@ module Draper object end end - + def self.undecorate_chain(object) if object.respond_to?(:decorated?) && object.decorated? undecorate_chain(object.object) diff --git a/lib/draper/view_context/build_strategy.rb b/lib/draper/view_context/build_strategy.rb index 3620e75..d1bdd3f 100644 --- a/lib/draper/view_context/build_strategy.rb +++ b/lib/draper/view_context/build_strategy.rb @@ -2,7 +2,6 @@ module Draper module ViewContext # @private module BuildStrategy - def self.new(name, &block) const_get(name.to_s.camelize).new(&block) end @@ -51,7 +50,6 @@ module Draper ActionController::TestRequest.method(:create).parameters.first == [:req, :controller_class] end end - end end end diff --git a/lib/draper/view_helpers.rb b/lib/draper/view_helpers.rb index d6ee9b1..5d2b015 100644 --- a/lib/draper/view_helpers.rb +++ b/lib/draper/view_helpers.rb @@ -5,7 +5,6 @@ module Draper extend ActiveSupport::Concern module ClassMethods - # Access the helpers proxy to call built-in and user-defined # Rails helpers from a class context. # @@ -14,7 +13,6 @@ module Draper Draper::ViewContext.current end alias_method :h, :helpers - end # Access the helpers proxy to call built-in and user-defined @@ -32,6 +30,5 @@ module Draper helpers.localize(*args) end alias_method :l, :localize - end end diff --git a/spec/draper/collection_decorator_spec.rb b/spec/draper/collection_decorator_spec.rb index b704fe1..d329e86 100644 --- a/spec/draper/collection_decorator_spec.rb +++ b/spec/draper/collection_decorator_spec.rb @@ -7,7 +7,6 @@ module Draper describe "#initialize" do describe "options validation" do - it "does not raise error on valid options" do valid_options = {with: Decorator, context: {}} expect{CollectionDecorator.new([], valid_options)}.not_to raise_error @@ -287,6 +286,5 @@ module Draper expect(decorator.replace([:foo, :bar])).to be decorator end end - end end diff --git a/spec/draper/decoratable_spec.rb b/spec/draper/decoratable_spec.rb index 2f6dbc5..8e673fa 100644 --- a/spec/draper/decoratable_spec.rb +++ b/spec/draper/decoratable_spec.rb @@ -3,7 +3,6 @@ require 'support/shared_examples/decoratable_equality' module Draper describe Decoratable do - describe "#decorate" do it "returns a decorator for self" do product = Product.new @@ -232,6 +231,5 @@ module Draper end end end - end end diff --git a/spec/draper/decorated_association_spec.rb b/spec/draper/decorated_association_spec.rb index 6aad959..d68205b 100644 --- a/spec/draper/decorated_association_spec.rb +++ b/spec/draper/decorated_association_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' module Draper describe DecoratedAssociation do - describe "#initialize" do it "accepts valid options" do valid_options = {with: Decorator, scope: :foo, context: {}} @@ -79,6 +78,5 @@ module Draper end end end - end end diff --git a/spec/draper/factory_spec.rb b/spec/draper/factory_spec.rb index fef1ec0..9a9ce24 100644 --- a/spec/draper/factory_spec.rb +++ b/spec/draper/factory_spec.rb @@ -2,7 +2,6 @@ require 'spec_helper' module Draper describe Factory do - describe "#initialize" do it "accepts valid options" do valid_options = {with: Decorator, context: {foo: "bar"}} @@ -88,11 +87,9 @@ module Draper end end end - end describe Factory::Worker do - describe "#call" do it "calls the decorator method" do object = double @@ -246,6 +243,5 @@ module Draper end end end - end end