Class: Longleaf::ServiceDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/longleaf/models/service_definition.rb

Overview

Definition of a configured preservation service

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, work_script:, work_class: nil, frequency: nil, delay: nil, properties: Hash.new) ⇒ ServiceDefinition

Returns a new instance of ServiceDefinition.

Raises:

  • (ArgumentError)


11
12
13
14
15
16
17
18
19
20
# File 'lib/longleaf/models/service_definition.rb', line 11

def initialize(name:, work_script:, work_class: nil, frequency: nil, delay: nil, properties: Hash.new)
  raise ArgumentError.new("Parameters name and work_script are required") unless name && work_script

  @properties = properties
  @name = name
  @work_script = work_script
  @work_class = work_class
  @frequency = frequency
  @delay = delay
end

Instance Attribute Details

#delayObject (readonly)

Returns the value of attribute delay.



8
9
10
# File 'lib/longleaf/models/service_definition.rb', line 8

def delay
  @delay
end

#frequencyObject (readonly)

Returns the value of attribute frequency.



8
9
10
# File 'lib/longleaf/models/service_definition.rb', line 8

def frequency
  @frequency
end

#nameObject (readonly)

Returns the value of attribute name.



6
7
8
# File 'lib/longleaf/models/service_definition.rb', line 6

def name
  @name
end

#propertiesObject (readonly)

Returns the value of attribute properties.



9
10
11
# File 'lib/longleaf/models/service_definition.rb', line 9

def properties
  @properties
end

#work_classObject (readonly)

Returns the value of attribute work_class.



7
8
9
# File 'lib/longleaf/models/service_definition.rb', line 7

def work_class
  @work_class
end

#work_scriptObject (readonly)

Returns the value of attribute work_script.



7
8
9
# File 'lib/longleaf/models/service_definition.rb', line 7

def work_script
  @work_script
end