Permalink
Browse files

Merge pull request #152 from JoeyButler/doc_draper_base

Add documentation for the options to Draper::Base.decorate
  • Loading branch information...
2 parents cbab407 + 00cd5b2 commit 7ccf0a6f2cb12f9933b577c66dda2dfc3cd4f32b @steveklabnik steveklabnik committed Mar 18, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/draper/base.rb
View
@@ -60,7 +60,7 @@ def self.decorates(input, options = {})
# the assocation to be decorated when it is retrieved.
#
# @param [Symbol] name of association to decorate, like `:products`
- # @option opts [Class] :with The decorator to decorate the association with
+ # @option options [Class] :with The decorator to decorate the association with
def self.decorates_association(association_symbol, options = {})
define_method(association_symbol) do
orig_association = model.send(association_symbol)
@@ -129,6 +129,8 @@ def self.allows(*input_allows)
#
# @param [Object] instance(s) to wrap
# @param [Hash] options (optional)
+ # @option options [Boolean] :infer If true, each model will be
+ # wrapped by its inferred decorator.
def self.decorate(input, options = {})
if input.instance_of?(self)
input.options = options unless options.empty?

0 comments on commit 7ccf0a6

Please sign in to comment.