Class: WhenHub::Schedule
- Inherits:
-
Object
- Object
- WhenHub::Schedule
- Includes:
- ActiveModel::Model
- Defined in:
- lib/whenhub/schedule.rb
Instance Attribute Summary collapse
-
#calendar ⇒ Object
Returns the value of attribute calendar.
-
#client ⇒ Object
Returns the value of attribute client.
-
#createdAt ⇒ Object
Returns the value of attribute createdAt.
-
#createdBy ⇒ Object
Returns the value of attribute createdBy.
-
#curator ⇒ Object
Returns the value of attribute curator.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#scope ⇒ Object
Returns the value of attribute scope.
-
#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.
-
#viewCode ⇒ Object
Returns the value of attribute viewCode.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#calendar ⇒ Object
Returns the value of attribute calendar.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def calendar @calendar end |
#client ⇒ Object
Returns the value of attribute client.
10 11 12 |
# File 'lib/whenhub/schedule.rb', line 10 def client @client end |
#createdAt ⇒ Object
Returns the value of attribute createdAt.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def createdAt @createdAt end |
#createdBy ⇒ Object
Returns the value of attribute createdBy.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def createdBy @createdBy end |
#curator ⇒ Object
Returns the value of attribute curator.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def curator @curator end |
#description ⇒ Object
Returns the value of attribute description.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def description @description end |
#id ⇒ Object
Returns the value of attribute id.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def name @name end |
#scope ⇒ Object
Returns the value of attribute scope.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def scope @scope end |
#tags ⇒ Object
Returns the value of attribute tags.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def @tags end |
#updatedAt ⇒ Object
Returns the value of attribute updatedAt.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def updatedAt @updatedAt end |
#updatedBy ⇒ Object
Returns the value of attribute updatedBy.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def updatedBy @updatedBy end |
#userId ⇒ Object
Returns the value of attribute userId.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def userId @userId end |
#viewCode ⇒ Object
Returns the value of attribute viewCode.
7 8 9 |
# File 'lib/whenhub/schedule.rb', line 7 def viewCode @viewCode end |
Class Method Details
.build(client, attributes) ⇒ Object
12 13 14 15 16 |
# File 'lib/whenhub/schedule.rb', line 12 def self.build(client, attributes) new(attributes).tap do |schedule| schedule.client = client end end |
Instance Method Details
#delete ⇒ Object
35 36 37 |
# File 'lib/whenhub/schedule.rb', line 35 def delete @client.delete("/api/schedules/#{id}") end |
#events ⇒ Object
39 40 41 |
# File 'lib/whenhub/schedule.rb', line 39 def events EventsCollection.new(client, self) end |
#save ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/whenhub/schedule.rb', line 18 def save assign_attributes( @client.post( '/api/users/me/schedules', writeable_attributes ) ) end |
#writeable_attributes ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/whenhub/schedule.rb', line 27 def writeable_attributes { name: name, description: description, scope: scope } end |