Method: GoodData::Project#add_metric
- Defined in:
- lib/gooddata/models/project.rb
#add_metric(metric, options = {}) ⇒ GoodData::Report Also known as: create_metric, add_measure, create_measure
Creates a metric in a project
767 768 769 770 771 772 773 774 |
# File 'lib/gooddata/models/project.rb', line 767 def add_metric(metric, = {}) default = { client: client, project: self } if metric.is_a?(String) GoodData::Metric.xcreate(metric, .merge(default)) else GoodData::Metric.xcreate([:expression], metric.merge(.merge(default))) end end |