Class: Aranha::StartPoint

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/aranha/start_point.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_processor_class(klass) ⇒ Object



8
9
10
# File 'app/models/aranha/start_point.rb', line 8

def add_processor_class(klass)
  processor_class_list_var.add(klass.to_s)
end

.processor_class_listObject



12
13
14
# File 'app/models/aranha/start_point.rb', line 12

def processor_class_list
  processor_class_list_var.to_enum
end

.processor_class_optionsObject



16
17
18
# File 'app/models/aranha/start_point.rb', line 16

def processor_class_options
  processor_class_list.map { |e| [e, e] }.to_h # rubocop:disable Style/MapToHash
end

Instance Method Details

#extra_dataObject



32
33
34
# File 'app/models/aranha/start_point.rb', line 32

def extra_data
  extra_data_yaml.nil? ? nil : ::EacRubyUtils::Yaml.load(extra_data_yaml)
end

#extra_data=(value) ⇒ Object



36
37
38
# File 'app/models/aranha/start_point.rb', line 36

def extra_data=(value)
  self.extra_data_yaml = ::EacRubyUtils::Yaml.dump(value)
end

#processor_class_in_listObject



40
41
42
43
44
45
# File 'app/models/aranha/start_point.rb', line 40

def processor_class_in_list
  return if processor_class.blank?
  return if self.class.processor_class_list.include?(processor_class)

  errors.add(:processor_class, 'Not in list')
end