Class: Podio::LinkedAccount

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

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes, #error_code, #error_message, #error_parameters, #error_propagate

Class Method Summary collapse

Methods inherited from ActivePodio::Base

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

Constructor Details

This class inherits a constructor from ActivePodio::Base

Class Method Details

.create(attributes) ⇒ Object



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

def create(attributes)
  response = Podio.connection.post do |req|
    req.url '/linked_account/'
    req.body = attributes
  end

  member response.body
end

.delete(id) ⇒ Object



27
28
29
# File 'lib/podio/models/linked_account.rb', line 27

def delete(id)
  Podio.connection.delete("/linked_account/#{id}").status
end

.find_all(provider, capability = nil) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/podio/models/linked_account.rb', line 10

def find_all(provider, capability = nil)
  options = { :provider => provider }
  options[:capability] = capability if capability.present?
  list Podio.connection.get { |req|
    req.url("/linked_account/", options)
  }.body
end