Class: WhenHub::Schedule
- Inherits:
-
Object
- Object
- WhenHub::Schedule
- Defined in:
- lib/whenhub/schedule.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
21 22 23 |
# File 'lib/whenhub/schedule.rb', line 21 def client @client end |
Class Method Details
.build(client, attributes) ⇒ Object
23 24 25 26 27 |
# File 'lib/whenhub/schedule.rb', line 23 def self.build(client, attributes) new(attributes).tap do |schedule| schedule.client = client end end |
Instance Method Details
#delete ⇒ Object
44 45 46 |
# File 'lib/whenhub/schedule.rb', line 44 def delete @client.delete("/api/schedules/#{id}") end |
#events ⇒ Object
48 49 50 |
# File 'lib/whenhub/schedule.rb', line 48 def events EventsCollection.new(client, self) end |
#save ⇒ Object
29 30 31 32 33 34 |
# File 'lib/whenhub/schedule.rb', line 29 def save self.attributes = @client.post( '/api/users/me/schedules', writeable_attributes ) end |
#writeable_attributes ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/whenhub/schedule.rb', line 36 def writeable_attributes { name: name, description: description, scope: scope } end |