Sha256: b05d68b192274eaae041feb1ab40bed761921b0d83f6f55bb4f845e7d32c1ea8
Contents?: true
Size: 580 Bytes
Versions: 9
Compression:
Stored size: 580 Bytes
Contents
module Trestle class Hook class Set attr_reader :hooks def initialize @hooks = {} end def append(name, options={}, &block) hooks[name.to_s] ||= [] hooks[name.to_s] << Hook.new(name.to_s, options, &block) end def any?(name) hooks.key?(name.to_s) && hooks[name.to_s].any? end def for(name) hooks.fetch(name.to_s) { [] } end def empty? hooks.empty? end def ==(other) other.is_a?(self.class) && hooks == other.hooks end end end end
Version data entries
9 entries across 9 versions & 1 rubygems