lib/azeroth/options.rb in azeroth-0.4.0 vs lib/azeroth/options.rb in azeroth-0.5.0
- old
+ new
@@ -4,19 +4,23 @@
# @api private
# @author Darthjee
#
# Resource buiilding options
class Options < ::OpenStruct
+ # Default options
DEFAULT_OPTIONS = {
only: %i[create destroy edit index new show update],
- except: []
+ except: [],
+ decorator: true
}.freeze
- # @param options [Hash] hash with options
+ # @param options [Hash] hash with options (see {Options::DEFAULT_OPTIONS})
# @option options only [Array<Symbol,String>] List of
# actions to be built
# @option options except [Array<Symbol,String>] List of
# actions to not to be built
+ # @option options decorator [Azeroth::Decorator,TrueClass,FalseClass]
+ # Decorator class or flag allowing/disallowing decorators
def initialize(options = {})
check_options(options)
super(DEFAULT_OPTIONS.merge(options))
end