Class: Basecamp::Services::SchedulesExtensions::ScheduleEntryFields
- Inherits:
-
Object
- Object
- Basecamp::Services::SchedulesExtensions::ScheduleEntryFields
- Defined in:
- lib/basecamp/services/schedules_extensions.rb
Overview
A schedule entry's writable state, yielded to the #edit_entry block.
The full-state members are plain accessors: they are resent whether or not the block touches them, so nothing has to be recorded. The carve-outs are readable — seeded from the read-back so a block can inspect the current join link, highlight and participants before deciding — but each writer records the address, and only an addressed carve-out reaches the wire.
Dirty tracking is by setter invocation, deliberately, and not by comparing the block's result against the read-back: assigning a carve-out the value the GET just returned is an address like any other. A diff would drop it, and the server would then hold whatever a concurrent writer left there instead of the value the caller stated.
Instance Attribute Summary collapse
-
#all_day ⇒ Object
Returns the value of attribute all_day.
-
#description ⇒ Object
Returns the value of attribute description.
-
#ends_at ⇒ Object
Returns the value of attribute ends_at.
-
#highlighted ⇒ Object
Returns the value of attribute highlighted.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#participant_ids ⇒ Object
Returns the value of attribute participant_ids.
-
#starts_at ⇒ Object
Returns the value of attribute starts_at.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#addressed?(name) ⇒ Boolean
Whether the caller addressed this carve-out, by assignment.
-
#initialize(summary:, starts_at:, ends_at:, description:, all_day:, participant_ids:, url:, highlighted:) ⇒ ScheduleEntryFields
constructor
A new instance of ScheduleEntryFields.
Constructor Details
#initialize(summary:, starts_at:, ends_at:, description:, all_day:, participant_ids:, url:, highlighted:) ⇒ ScheduleEntryFields
Returns a new instance of ScheduleEntryFields.
116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 116 def initialize(summary:, starts_at:, ends_at:, description:, all_day:, participant_ids:, url:, highlighted:) @summary = summary @starts_at = starts_at @ends_at = ends_at @description = description @all_day = all_day @participant_ids = participant_ids @url = url @highlighted = highlighted # Nothing in the response seeds a directive. @notify = nil @addressed = {} end |
Instance Attribute Details
#all_day ⇒ Object
Returns the value of attribute all_day.
113 114 115 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 113 def all_day @all_day end |
#description ⇒ Object
Returns the value of attribute description.
113 114 115 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 113 def description @description end |
#ends_at ⇒ Object
Returns the value of attribute ends_at.
113 114 115 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 113 def ends_at @ends_at end |
#highlighted ⇒ Object
Returns the value of attribute highlighted.
114 115 116 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 114 def highlighted @highlighted end |
#notify ⇒ Object
Returns the value of attribute notify.
114 115 116 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 114 def notify @notify end |
#participant_ids ⇒ Object
Returns the value of attribute participant_ids.
114 115 116 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 114 def participant_ids @participant_ids end |
#starts_at ⇒ Object
Returns the value of attribute starts_at.
113 114 115 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 113 def starts_at @starts_at end |
#summary ⇒ Object
Returns the value of attribute summary.
113 114 115 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 113 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url.
114 115 116 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 114 def url @url end |
Instance Method Details
#addressed?(name) ⇒ Boolean
Whether the caller addressed this carve-out, by assignment.
152 153 154 |
# File 'lib/basecamp/services/schedules_extensions.rb', line 152 def addressed?(name) @addressed.key?(name) end |