Module: Transpec::Syntax::Collection
- Included in:
- Transpec::Syntax
- Defined in:
- lib/transpec/syntax.rb
Instance Method Summary collapse
- #all_syntaxes ⇒ Object
- #inherited(subclass) ⇒ Object
- #require_all ⇒ Object
- #standalone_syntaxes ⇒ Object
Instance Method Details
#all_syntaxes ⇒ Object
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_all ⇒ Object
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_syntaxes ⇒ Object
27 28 29 |
# File 'lib/transpec/syntax.rb', line 27 def standalone_syntaxes @standalone_syntaxes ||= all_syntaxes.select(&:standalone?) end |