Module: LetBang

Included in:
Shaf::Spec::Base
Defined in:
lib/shaf/spec/let_bang.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



16
17
18
# File 'lib/shaf/spec/let_bang.rb', line 16

def self.included(base)
  base.extend ClassMethods
end

Instance Method Details

#let_bangsObject



20
21
22
23
24
25
26
27
28
29
# File 'lib/shaf/spec/let_bang.rb', line 20

def let_bangs
  klass = self.class
  Set.new.tap do |bangs|
    loop do
      bangs.merge(klass.let_bangs) if klass.respond_to? :let_bangs
      klass = klass.superclass
      break if Object == klass
    end
  end
end