Class: Jets::Job::Task

Inherits:
Lambda::Task show all
Defined in:
lib/jets/job/task.rb

Instance Attribute Summary collapse

Attributes inherited from Lambda::Task

#class_name, #iam_policy, #lang, #managed_iam_policy, #meth, #properties, #type

Instance Method Summary collapse

Methods inherited from Lambda::Task

#build_function_iam?, #full_handler, #get_type, #handler_base, #handler_path, #lang_ext, #name, #poly_src_path

Constructor Details

#initialize(class_name, meth, options = {}) ⇒ Task

Returns a new instance of Task.



3
4
5
6
7
8
# File 'lib/jets/job/task.rb', line 3

def initialize(class_name, meth, options={})
  super
  @rate = options[:rate]
  @cron = options[:cron]
  @state = options[:state] || 'ENABLED'
end

Instance Attribute Details

#stateObject (readonly)

Returns the value of attribute state.



2
3
4
# File 'lib/jets/job/task.rb', line 2

def state
  @state
end

Instance Method Details

#schedule_expressionObject



10
11
12
13
14
15
16
# File 'lib/jets/job/task.rb', line 10

def schedule_expression
  if @rate
    "rate(#{@rate})"
  elsif @cron
    "cron(#{@cron})"
  end
end