Sha256: 4bb3adb65daa548e4887f734d983658b4224f4c5923b66fc24f7f79ac29f6adb
Contents?: true
Size: 856 Bytes
Versions: 12
Compression:
Stored size: 856 Bytes
Contents
class ExtensionHelper < SimpleDelegator attr_reader :params, :builder attr_accessor :extension def initialize(params, builder, defaults = {}) # TODO: We should allow for default values to be passed in here # That will allow for defaults to be pulled out of the extension and it # will also let better enable overriding of those values that do not have # an option to do so currently. if params.is_a? Hash @params = defaults.merge params else @params = params end @builder = builder super @params end def method_missing(name, *args, &block) return super unless extension.parameters.include? name self[name] end # TODO: Method missing that pulls out of params? # That would allow everything to just call helper.foo # and then the helper can do any fiddling it needs to (or not) end
Version data entries
12 entries across 12 versions & 1 rubygems