Module: Rubyzen::Providers::AttributesProvider
- Defined in:
- lib/rubyzen/providers/attributes_provider.rb
Overview
Provides access to attr_reader, attr_writer, and attr_accessor declarations.
Instance Method Summary collapse
-
#attributes ⇒ Rubyzen::Collections::AttributesCollection
Collection of attribute declarations.
Instance Method Details
#attributes ⇒ Rubyzen::Collections::AttributesCollection
Returns collection of attribute declarations.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/rubyzen/providers/attributes_provider.rb', line 6 def attributes attribute_nodes = node.each_descendant(:send).select do |send_node| %w[attr_reader attr_writer attr_accessor].include?(send_node.method_name.to_s) end attribute_declarations = attribute_nodes.map do |attr_node| Rubyzen::Declarations::AttributeDeclaration.new(attr_node, self) end Rubyzen::Collections::AttributesCollection.new(attribute_declarations) end |