Sha256: fc5a2285108810902e72dfb8c58aa0e37d5dc1361d4f3036e83a20c743ebd685
Contents?: true
Size: 751 Bytes
Versions: 4
Compression:
Stored size: 751 Bytes
Contents
module Adhearsion class Plugin class Initializer attr_reader :name, :block def initialize(name, context, options, &block) options[:group] ||= :default @name, @context, @options, @block = name, context, options, block end def before @options[:before] end def after @options[:after] end def belongs_to?(group) @options[:group] == group || @options[:group] == :all end def run(*args) @context.instance_exec *args, &block end def bind(context) return self if @context Initializer.new @name, context, @options, &block end def to_s "#{self.name}: #{@options}" end end end end
Version data entries
4 entries across 4 versions & 1 rubygems