lib/attribute_extras.rb in attribute_extras-0.1.2 vs lib/attribute_extras.rb in attribute_extras-0.1.3
- old
+ new
@@ -1,17 +1,24 @@
require 'attribute_extras/extra_builder'
require 'attribute_extras/hook_builder'
require 'attribute_extras/modifier'
+require 'logger'
+# Used for automatic attribute manipulation
module AttributeExtras
# the registered extras
mattr_accessor :extras
self.extras = []
# wrap up configuration options into one block
def self.configure(&block)
yield self
+ end
+
+ # the logger for attribute extras
+ def self.logger
+ @logger ||= Logger.new($stderr)
end
# register the extra and build the functions
def self.register_extra(verb, function, past:, validator:, options: nil)
past ||= verb