Class: Basecamp3::MessageType
- Defined in:
- lib/basecamp3/models/message_type.rb
Overview
A model for Basecamp's Message Board
For more information, see the official Basecamp3 API documentation for Message types
Constant Summary
- REQUIRED_FIELDS =
%w(name icon)
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Class Method Summary collapse
-
.all(bucket_id) ⇒ Array<Basecamp3::MessageType>
Returns a list of all the message types.
-
.create(bucket_id, data) ⇒ Basecamp3::MessageType
Creates a message type.
-
.delete(bucket_id, id) ⇒ Boolean
Deletes the message type.
-
.find(bucket_id, id) ⇒ Basecamp3::MessageType
Returns the message type.
-
.update(bucket_id, id, data) ⇒ Basecamp3::MessageType
Updates a message type.
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at
5 6 7 |
# File 'lib/basecamp3/models/message_type.rb', line 5 def created_at @created_at end |
#icon ⇒ Object
Returns the value of attribute icon
5 6 7 |
# File 'lib/basecamp3/models/message_type.rb', line 5 def icon @icon end |
#id ⇒ Object
Returns the value of attribute id
5 6 7 |
# File 'lib/basecamp3/models/message_type.rb', line 5 def id @id end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/basecamp3/models/message_type.rb', line 5 def name @name end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
5 6 7 |
# File 'lib/basecamp3/models/message_type.rb', line 5 def updated_at @updated_at end |
Class Method Details
.all(bucket_id) ⇒ Array<Basecamp3::MessageType>
Returns a list of all the message types.
18 19 20 |
# File 'lib/basecamp3/models/message_type.rb', line 18 def self.all(bucket_id) Basecamp3.request.get("/buckets/#{bucket_id}/categories", {}, Basecamp3::MessageType) end |
.create(bucket_id, data) ⇒ Basecamp3::MessageType
Creates a message type.
40 41 42 43 |
# File 'lib/basecamp3/models/message_type.rb', line 40 def self.create(bucket_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/categories", data, Basecamp3::MessageType) end |
.delete(bucket_id, id) ⇒ Boolean
Deletes the message type.
65 66 67 |
# File 'lib/basecamp3/models/message_type.rb', line 65 def self.delete(bucket_id, id) Basecamp3.request.delete("/buckets/#{bucket_id}/categories/#{id}") end |
.find(bucket_id, id) ⇒ Basecamp3::MessageType
Returns the message type.
28 29 30 |
# File 'lib/basecamp3/models/message_type.rb', line 28 def self.find(bucket_id, id) Basecamp3.request.get("/buckets/#{bucket_id}/categories/#{id}", {}, Basecamp3::MessageType) end |
.update(bucket_id, id, data) ⇒ Basecamp3::MessageType
Updates a message type.
54 55 56 57 |
# File 'lib/basecamp3/models/message_type.rb', line 54 def self.update(bucket_id, id, data) self.validate_required(data) Basecamp3.request.put("/buckets/#{bucket_id}/categories/#{id}", data, Basecamp3::MessageType) end |