Extract method to build a data source

This commit is contained in:
Javi Martín
2024-05-08 16:08:28 +02:00
parent 631b48f586
commit d44cff630d
2 changed files with 11 additions and 9 deletions

View File

@@ -4,6 +4,10 @@
module Ahoy
class DataSource
def self.build(&block)
new.tap { |data_source| block.call(data_source) }.build
end
# Adds a collection with the datasource
# Name is the name of the collection and will be showed in the
# chart