Module: Transpec::Syntax::Collection

Included in:
Transpec::Syntax
Defined in:
lib/transpec/syntax.rb

Instance Method Summary collapse

Instance Method Details

#all_syntaxesObject



23
24
25
# File 'lib/transpec/syntax.rb', line 23

def all_syntaxes
  @subclasses ||= []
end

#inherited(subclass) ⇒ Object



12
13
14
# File 'lib/transpec/syntax.rb', line 12

def inherited(subclass)
  all_syntaxes << subclass
end

#require_allObject



16
17
18
19
20
21
# File 'lib/transpec/syntax.rb', line 16

def require_all
  pattern = File.join(File.dirname(__FILE__), 'syntax', '*.rb')
  Dir.glob(pattern) do |path|
    require path
  end
end

#standalone_syntaxesObject



27
28
29
# File 'lib/transpec/syntax.rb', line 27

def standalone_syntaxes
  @standalone_syntaxes ||= all_syntaxes.select(&:standalone?)
end