Module: Rubyzen::Providers::MacrosProvider
- Included in:
- Declarations::ClassDeclaration
- Defined in:
- lib/rubyzen/providers/macros_provider.rb
Overview
Provides access to macro-style method calls (e.g., validates, has_many) within a declaration.
Instance Method Summary collapse
-
#macros ⇒ Rubyzen::Collections::MacrosCollection
Collection of macro declarations.
Instance Method Details
#macros ⇒ Rubyzen::Collections::MacrosCollection
Returns collection of macro declarations.
6 7 8 9 10 11 12 13 14 |
# File 'lib/rubyzen/providers/macros_provider.rb', line 6 def macros macros_nodes = node.each_descendant(:send).select(&:macro?) macros_declarations = macros_nodes.map do |macro_node| Rubyzen::Declarations::MacroDeclaration.new(macro_node, self) end Rubyzen::Collections::MacrosCollection.new(macros_declarations) end |