lib/attribute_extras.rb in attribute_extras-0.1.0 vs lib/attribute_extras.rb in attribute_extras-0.1.1
- old
+ new
@@ -7,9 +7,14 @@
# the registered extras
mattr_accessor :extras
self.extras = []
+ # wrap up configuration options into one block
+ def self.configure(&block)
+ yield self
+ end
+
# register the extra and build the functions
def self.register_extra(verb, function, past:, validator:, options: nil)
past ||= verb
compiled_validator = validator.is_a?(Proc) ? validator : ->(options){ validator }
options ||= ->(attribute){ {} }