Class: Podio::Status

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

Overview

Instance Attribute Summary

Attributes inherited from ActivePodio::Base

#attributes

Class Method Summary collapse

Instance 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(space_id, attributes = [], options = {}) ⇒ Object



50
51
52
53
54
55
56
57
# File 'lib/podio/models/status.rb', line 50

def create(space_id, attributes=[], options={})
  response = Podio.connection.post do |req|
    req.url("/status/space/#{space_id}/", options)
    req.body = attributes
  end

  response.body['status_id']
end

.delete(id) ⇒ Object



60
61
62
# File 'lib/podio/models/status.rb', line 60

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

.find(id) ⇒ Object



45
46
47
# File 'lib/podio/models/status.rb', line 45

def find(id)
  member Podio.connection.get("/status/#{id}").body
end

Instance Method Details

#destroyObject



39
40
41
# File 'lib/podio/models/status.rb', line 39

def destroy
  Status.delete(self.id)
end