Sha256: 139a508bf1cab185308262e9f1680c26b8dc26f930cb7af97b3351b0385e61a4
Contents?: true
Size: 404 Bytes
Versions: 10
Compression:
Stored size: 404 Bytes
Contents
class AddMetric < Struct.new :project_name, :type, :name def call project = project, metric = metric project.add_metric(metric) end def project project_name = project_name Project.find_by(name: project_name) end def metric metric_class = metric_class, name = name metric_class.new name: name end def metric_class type = type "#{type}Metric".classify.constantize end end
Version data entries
10 entries across 10 versions & 1 rubygems