Repository URL to install this package:
|
Version:
0.5.0.beta1 ▾
|
module Scrapbook
class << self
attr_reader :config
def configure
@config = Configuration.new
yield config
end
end
class Configuration
SETTINGS = [:metadata_fields, :contexts, :before_action, :paperclip_processors]
attr_accessor(*SETTINGS)
def initialize
@metadata_fields = HashWithIndifferentAccess.new
@contexts = HashWithIndifferentAccess.new
@paperclip_processors = [:cropped_resize]
end
def register_field(*args)
field = MetadataField.new(*args)
@metadata_fields[field.name] = field
end
def register_context(*args)
context = Context.new(*args)
@contexts[context.name] = context
end
end
end