class Promoter::Metric
Constants
- API_URL
Attributes
campaign_name[RW]
nps[RW]
organization_nps[RW]
Public Class Methods
all(options={})
click to toggle source
# File lib/promoter/metric.rb, line 15 def self.all(options={}) query_string = URI.encode_www_form(options) response = Request.get("#{API_URL}/?#{query_string}") response['results'].map {|attrs| new(attrs)} end
new(attrs)
click to toggle source
# 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