Class: WhenHub::Event
- Inherits:
-
Object
- Object
- WhenHub::Event
- Includes:
- ActiveModel::Model
- Defined in:
- lib/whenhub/event.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#createdAt ⇒ Object
Returns the value of attribute createdAt.
-
#createdBy ⇒ Object
Returns the value of attribute createdBy.
-
#customFieldData ⇒ Object
Returns the value of attribute customFieldData.
-
#description ⇒ Object
Returns the value of attribute description.
-
#draft ⇒ Object
Returns the value of attribute draft.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#id ⇒ Object
Returns the value of attribute id.
-
#location ⇒ Object
Returns the value of attribute location.
-
#name ⇒ Object
Returns the value of attribute name.
-
#order ⇒ Object
Returns the value of attribute order.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#resources ⇒ Object
Returns the value of attribute resources.
-
#scheduleId ⇒ Object
Returns the value of attribute scheduleId.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#updatedAt ⇒ Object
Returns the value of attribute updatedAt.
-
#updatedBy ⇒ Object
Returns the value of attribute updatedBy.
-
#userId ⇒ Object
Returns the value of attribute userId.
-
#when ⇒ Object
Returns the value of attribute when.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
11 12 13 |
# File 'lib/whenhub/event.rb', line 11 def client @client end |
#createdAt ⇒ Object
Returns the value of attribute createdAt.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def createdAt @createdAt end |
#createdBy ⇒ Object
Returns the value of attribute createdBy.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def createdBy @createdBy end |
#customFieldData ⇒ Object
Returns the value of attribute customFieldData.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def customFieldData @customFieldData end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def description @description end |
#draft ⇒ Object
Returns the value of attribute draft.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def draft @draft end |
#icon ⇒ Object
Returns the value of attribute icon.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def icon @icon end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def id @id end |
#location ⇒ Object
Returns the value of attribute location.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def location @location end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def name @name end |
#order ⇒ Object
Returns the value of attribute order.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def order @order end |
#priority ⇒ Object
Returns the value of attribute priority.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def priority @priority end |
#resources ⇒ Object
Returns the value of attribute resources.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def resources @resources end |
#scheduleId ⇒ Object
Returns the value of attribute scheduleId.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def scheduleId @scheduleId end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def end |
#updatedAt ⇒ Object
Returns the value of attribute updatedAt.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def updatedAt @updatedAt end |
#updatedBy ⇒ Object
Returns the value of attribute updatedBy.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def updatedBy @updatedBy end |
#userId ⇒ Object
Returns the value of attribute userId.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def userId @userId end |
#when ⇒ Object
Returns the value of attribute when.
7 8 9 |
# File 'lib/whenhub/event.rb', line 7 def when @when end |
Class Method Details
.build(client, schedule, attributes) ⇒ Object
13 14 15 16 17 18 |
# File 'lib/whenhub/event.rb', line 13 def self.build(client, schedule, attributes) new(attributes).tap do |event| event.client = client event.scheduleId = schedule.id end end |
Instance Method Details
#delete ⇒ Object
38 39 40 |
# File 'lib/whenhub/event.rb', line 38 def delete @client.delete("/api/events/#{id}") end |
#save ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/whenhub/event.rb', line 20 def save assign_attributes( @client.post( "/api/users/me/schedules/#{scheduleId}/events", writeable_attributes ).first ) end |
#writeable_attributes ⇒ Object
29 30 31 32 33 34 35 36 |
# File 'lib/whenhub/event.rb', line 29 def writeable_attributes { when: self.when, name: name, description: description, scheduleId: scheduleId } end |