Sha256: 2e3d8daaa37c6316d94227a01e5039cf33aa41061c0300b8d4118963ea0282fd
Contents?: true
Size: 447 Bytes
Versions: 1
Compression:
Stored size: 447 Bytes
Contents
module Sinatra module Decorator module Decoratable def decorate(options = {}) return @decorator if @decorator klass = options[:as] klass_name = "#{self.class}Decorator" klass = klass_name.constantize if klass.nil? decorator = klass.new(self, context: self) yield decorator if block_given? @decorator = decorator end end # Decoratable end # Decorator end # Sinatra
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sinatra-decorator-0.2.0 | lib/sinatra/decorator/decoratable.rb |