Class: Promoter::Metric
- Inherits:
-
Object
- Object
- Promoter::Metric
- Defined in:
- lib/promoter/metric.rb
Constant Summary collapse
- API_URL =
"https://app.promoter.io/api/metrics"
Instance Attribute Summary collapse
-
#campaign_name ⇒ Object
Returns the value of attribute campaign_name.
-
#nps ⇒ Object
Returns the value of attribute nps.
-
#organization_nps ⇒ Object
Returns the value of attribute organization_nps.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Metric
constructor
A new instance of Metric.
Constructor Details
#initialize(attrs) ⇒ Metric
Returns a new instance of Metric.
9 10 11 12 13 |
# File 'lib/promoter/metric.rb', line 9 def initialize(attrs) @campaign_name = attrs["campaign_name"] @nps = attrs["nps"].to_f @organization_nps = attrs["organization_nps"].to_f end |
Instance Attribute Details
#campaign_name ⇒ Object
Returns the value of attribute campaign_name.
5 6 7 |
# File 'lib/promoter/metric.rb', line 5 def campaign_name @campaign_name end |
#nps ⇒ Object
Returns the value of attribute nps.
5 6 7 |
# File 'lib/promoter/metric.rb', line 5 def nps @nps end |
#organization_nps ⇒ Object
Returns the value of attribute organization_nps.
5 6 7 |
# File 'lib/promoter/metric.rb', line 5 def organization_nps @organization_nps end |