Class: Fluentd::Setting::OutForward
- Inherits:
-
Object
- Object
- Fluentd::Setting::OutForward
show all
- Includes:
- Common
- Defined in:
- app/models/fluentd/setting/out_forward.rb
Defined Under Namespace
Classes: Secondary, Server
Constant Summary
collapse
- KEYS =
[
:match,
:send_timeout, :recover_wait, :heartbeat_type, :heartbeat_interval,
:phi_threshold, :hard_timeout,
:server, :secondary
].freeze
Instance Method Summary
collapse
Methods included from Common
#boolenan, #child_class, #children_of, #column_type, #conf, #empty_value?, #flag, #input_plugin?, #output_plugin?, #plugin_type_name, #print_if_present, #to_config, #values_of
Instance Method Details
#validate_has_at_least_one_server ⇒ Object
48
49
50
51
52
|
# File 'app/models/fluentd/setting/out_forward.rb', line 48
def validate_has_at_least_one_server
if children_of(:server).reject{|s| s.empty_value? }.blank?
errors.add(:base, :out_forward_blank_server)
end
end
|
#validate_nested_values ⇒ Object
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
# File 'app/models/fluentd/setting/out_forward.rb', line 54
def validate_nested_values
self.class.children.inject(true) do |result, (key, _)|
children_of(key).each do |child|
if !child.empty_value? && !child.valid?
child.errors.full_messages.each do |message|
errors.add(:base, "(#{key})#{message}")
end
result = false
end
result
end
result
end
end
|