Class: Basecamp3::ScheduleEntry
- Includes:
- Concerns::Bucketable, Concerns::Commentable, Concerns::Creatorable, Concerns::Parentable, Concerns::Recordingable
- Defined in:
- lib/basecamp3/models/schedule_entry.rb
Overview
A model for Basecamp's Schedule Entry
For more information, see the official Basecamp3 API documentation for Schedule entries
Constant Summary
- REQUIRED_FIELDS =
%w(summary starts_at ends_at)
Instance Attribute Summary collapse
-
#all_day ⇒ Object
Returns the value of attribute all_day.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#description ⇒ Object
Returns the value of attribute description.
-
#ends_at ⇒ Object
Returns the value of attribute ends_at.
-
#id ⇒ Object
Returns the value of attribute id.
-
#starts_at ⇒ Object
Returns the value of attribute starts_at.
-
#status ⇒ Object
Returns the value of attribute status.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#updated_at ⇒ Object
Returns the value of attribute updated_at.
Attributes included from Concerns::Commentable
Class Method Summary collapse
-
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::ScheduleEntry>
Returns a paginated list of active schedule entries.
-
.create(bucket_id, parent_id, data) ⇒ Basecamp3::ScheduleEntry
Creates a schedule entry.
-
.find(bucket_id, id) ⇒ Basecamp3::ScheduleEntry
Returns the schedule entry.
-
.update(bucket_id, id, data) ⇒ Basecamp3::ScheduleEntry
Updates the schedule entry.
Instance Method Summary collapse
-
#participants ⇒ Array<Basecamp3::Person>
Returns a list of related participants.
Methods included from Concerns::Commentable
Methods included from Concerns::Recordingable
Methods included from Concerns::Parentable
Methods included from Concerns::Bucketable
Methods included from Concerns::Creatorable
Methods inherited from Model
Constructor Details
This class inherits a constructor from Basecamp3::Model
Instance Attribute Details
#all_day ⇒ Object
Returns the value of attribute all_day
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def all_day @all_day end |
#created_at ⇒ Object
Returns the value of attribute created_at
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def created_at @created_at end |
#description ⇒ Object
Returns the value of attribute description
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def description @description end |
#ends_at ⇒ Object
Returns the value of attribute ends_at
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def ends_at @ends_at end |
#id ⇒ Object
Returns the value of attribute id
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def id @id end |
#starts_at ⇒ Object
Returns the value of attribute starts_at
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def starts_at @starts_at end |
#status ⇒ Object
Returns the value of attribute status
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def status @status end |
#summary ⇒ Object
Returns the value of attribute summary
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def summary @summary end |
#updated_at ⇒ Object
Returns the value of attribute updated_at
11 12 13 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 11 def updated_at @updated_at end |
Class Method Details
.all(bucket_id, parent_id, params = {}) ⇒ Array<Basecamp3::ScheduleEntry>
Returns a paginated list of active schedule entries.
39 40 41 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 39 def self.all(bucket_id, parent_id, params = {}) Basecamp3.request.get("/buckets/#{bucket_id}/schedules/#{parent_id}/entries", params, Basecamp3::ScheduleEntry) end |
.create(bucket_id, parent_id, data) ⇒ Basecamp3::ScheduleEntry
Creates a schedule entry.
and instead will be held for the entire day or days denoted in starts_at and ends_at
69 70 71 72 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 69 def self.create(bucket_id, parent_id, data) self.validate_required(data) Basecamp3.request.post("/buckets/#{bucket_id}/schedules/#{parent_id}/entries", data, Basecamp3::ScheduleEntry) end |
.find(bucket_id, id) ⇒ Basecamp3::ScheduleEntry
Returns the schedule entry.
49 50 51 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 49 def self.find(bucket_id, id) Basecamp3.request.get("/buckets/#{bucket_id}/schedule_entries/#{id}", {}, Basecamp3::ScheduleEntry) end |
.update(bucket_id, id, data) ⇒ Basecamp3::ScheduleEntry
Updates the schedule entry.
and instead will be held for the entire day or days denoted in starts_at and ends_at
89 90 91 92 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 89 def self.update(bucket_id, id, data) self.validate_required(data) Basecamp3.request.put("/buckets/#{bucket_id}/schedule_entries/#{id}", data, Basecamp3::ScheduleEntry) end |
Instance Method Details
#participants ⇒ Array<Basecamp3::Person>
Returns a list of related participants.
26 27 28 29 30 |
# File 'lib/basecamp3/models/schedule_entry.rb', line 26 def participants return [] if @participants.nil? @mapped_participants ||= @participants.map{ |p| Basecamp3::Person.new(p) } end |