Class: BatchlyApi::JobSchedule

Inherits:
Object
  • Object
show all
Defined in:
lib/batchly_api/models/job_schedule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name) ⇒ Object



17
18
19
# File 'lib/batchly_api/models/job_schedule.rb', line 17

def method_missing (method_name)
  puts "there's no method called '#{method_name}'"
end

Instance Attribute Details

#cronString

Time Schedule for the Job in CRON notation format.

http://www.nncron.ru/help/EN/working/cron-format.htm

Returns:

  • (String)


9
10
11
# File 'lib/batchly_api/models/job_schedule.rb', line 9

def cron
  @cron
end

#timezoneString

Timezone Identifier for the Scheduled Job. Identifier should be a valid value in the standard timezone list published by Microsoft.

https://msdn.microsoft.com/en-us/library/gg154758.aspx

Returns:

  • (String)


14
15
16
# File 'lib/batchly_api/models/job_schedule.rb', line 14

def timezone
  @timezone
end

Instance Method Details

#key_mapObject

Defines the key map for json serialization



28
29
30
31
32
33
# File 'lib/batchly_api/models/job_schedule.rb', line 28

def key_map
  hash = {}
  hash['Cron'] = self.cron
  hash['Timezone'] = self.timezone
  hash
end

#to_jsonObject

Creates JSON of the curent object



22
23
24
25
# File 'lib/batchly_api/models/job_schedule.rb', line 22

def to_json
  hash = self.key_map()
  hash.to_json
end