Class: Podio::NetPromoterScore

Inherits:
ActivePodio::Base show all
Defined in:
lib/podio/models/net_promoter_score.rb

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes

Class Method Summary collapse

Methods inherited from ActivePodio::Base

#==, #[], #[]=, #api_friendly_ref_type, #as_json, collection, delegate_to_hash, has_many, has_one, #hash, #initialize, #initialize_attributes, klass_from_string, list, member, #new_record?, output_attribute_as_json, #parent_model, #persisted?, property, #to_param

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.create(attributes = []) ⇒ Object



13
14
15
16
17
18
# File 'lib/podio/models/net_promoter_score.rb', line 13

def create(attributes=[])
  member Podio.connection.post { |req|
    req.url("/nps/")
    req.body = attributes
  }.body
end

.update(nps_id, attributes) ⇒ Object



20
21
22
23
24
25
# File 'lib/podio/models/net_promoter_score.rb', line 20

def update(nps_id, attributes)
  member Podio.connection.put { |req|
    req.url("/nps/#{nps_id}")
    req.body = attributes
  }.body
end