File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -167,11 +167,23 @@ def execution_profile(name)
167167 @profile_manager . profiles [ name ]
168168 end
169169
170- # @return [Hash<String, Cassandra::Execution::Profile>] the collection of execution profiles
171- def execution_profiles
172- # Return a dup of the hash to prevent the user from adding/removing profiles from the profile-manager.
173- @profile_manager . profiles . dup
170+ # Yield or enumerate each execution profile defined in this cluster
171+ # @overload each_execution_profile
172+ # @yieldparam name [String, Symbol] name of current profile
173+ # @yieldparam profile [Cassandra::Execution::Profile] current profile
174+ # @return [Cassandra::Cluster] self
175+ # @overload each_execution_profile
176+ # @return [Hash<String, Cassandra::Execution::Profile>] a hash of profiles keyed on name
177+ def each_execution_profile ( &block )
178+ if block_given?
179+ @profile_manager . profiles . each_pair ( &block )
180+ self
181+ else
182+ # Return a dup of the hash to prevent the user from adding/removing profiles from the profile-manager.
183+ @profile_manager . profiles . dup
184+ end
174185 end
186+ alias execution_profiles each_execution_profile
175187
176188 # @!method refresh_schema_async
177189 # Trigger an asynchronous schema metadata refresh
You can’t perform that action at this time.
0 commit comments