Class: PerfectSched::Schedule

Inherits:
Object
  • Object
show all
Includes:
Model
Defined in:
lib/perfectsched/schedule.rb

Direct Known Subclasses

ScheduleWithMetadata

Instance Attribute Summary collapse

Attributes included from Model

#client

Instance Method Summary collapse

Methods included from Model

#config

Constructor Details

#initialize(client, key) ⇒ Schedule

Returns a new instance of Schedule.



24
25
26
27
# File 'lib/perfectsched/schedule.rb', line 24

def initialize(client, key)
  super(client)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



29
30
31
# File 'lib/perfectsched/schedule.rb', line 29

def key
  @key
end

Instance Method Details

#delete!(options = {}) ⇒ Object



31
32
33
# File 'lib/perfectsched/schedule.rb', line 31

def delete!(options={})
  @client.delete(@key, options)
end

#exists?(options = {}) ⇒ Boolean

Returns:

  • (Boolean)


39
40
41
42
43
44
# File 'lib/perfectsched/schedule.rb', line 39

def exists?(options={})
  (options)
  true
rescue NotFoundError
  false
end

#inspectObject



46
47
48
# File 'lib/perfectsched/schedule.rb', line 46

def inspect
  "#<#{self.class} @key=#{@key.inspect}>"
end

#metadata(options = {}) ⇒ Object



35
36
37
# File 'lib/perfectsched/schedule.rb', line 35

def (options={})
  @client.(@key, options)
end