Module: Rubyzen::Providers::ReturnsProvider
- Defined in:
- lib/rubyzen/providers/returns_provider.rb
Overview
Provides the points at which a method or block yields a value: the implicit final expression of its body, plus every explicit return. Each is wrapped in a Declarations::ReturnDeclaration, which knows how to extract its own value.
Instance Method Summary collapse
-
#return_expressions ⇒ Rubyzen::Collections::ExpressionsCollection
The value-expression(s) this method or block evaluates to, as a flat collection.
- #returns ⇒ Rubyzen::Collections::ReturnsCollection
Instance Method Details
#return_expressions ⇒ Rubyzen::Collections::ExpressionsCollection
The value-expression(s) this method or block evaluates to, as a flat collection. A shortcut for returns.expressions.
20 21 22 |
# File 'lib/rubyzen/providers/returns_provider.rb', line 20 def return_expressions returns.expressions end |
#returns ⇒ Rubyzen::Collections::ReturnsCollection
8 9 10 11 12 13 14 |
# File 'lib/rubyzen/providers/returns_provider.rb', line 8 def returns Collections::ReturnsCollection.new( return_nodes.map do |return_node| Declarations::ReturnDeclaration.new(return_node, self) end ) end |