Class: Cult::EventTask

Inherits:
Task
  • Object
show all
Defined in:
lib/cult/task.rb

Constant Summary collapse

EVENT_TYPES =
[:sync]
EVENT_RE =
/^(#{EVENT_TYPES.join('|')})(?:\-P(\d+))?\-?/

Instance Attribute Summary collapse

Attributes inherited from Task

#name, #path, #role

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Task

all_for_role, collection_name, #file_mode, #relative_path, spawn

Methods included from SingletonInstances

included

Methods included from Transferable

#binary?, #collection_name, #contents, #file_mode, included, #name, #remote_path, #role_relative_path

Constructor Details

#initialize(role, path) ⇒ EventTask

Returns a new instance of EventTask.



97
98
99
100
101
# File 'lib/cult/task.rb', line 97

def initialize(role, path)
  super
  @event = event_name(name)
  @pass = pass_name(name)
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



89
90
91
# File 'lib/cult/task.rb', line 89

def event
  @event
end

#passObject (readonly)

Returns the value of attribute pass.



90
91
92
# File 'lib/cult/task.rb', line 90

def pass
  @pass
end

Class Method Details

.valid_name?(basename) ⇒ Boolean

Returns:

  • (Boolean)


92
93
94
# File 'lib/cult/task.rb', line 92

def self.valid_name?(basename)
  !! basename.match(EVENT_RE)
end