Class: Podio::Device

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

Overview

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

.find_all_for_user(user_id) ⇒ Object



8
9
10
# File 'lib/podio/models/device.rb', line 8

def find_all_for_user(user_id)
  list Podio.connection.get("/mobile/user/#{user_id}").body
end

.send_test(user_id, attributes) ⇒ Object



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

def send_test(user_id, attributes)
  response = Podio.connection.post do |req|
    req.url "/mobile/user/#{user_id}/test"
    req.body = attributes
  end

  response.body['pushed']
end