Class: LIVR::Rules::Modifiers::Default

Inherits:
LIVR::Rule
  • Object
show all
Defined in:
lib/livr/rules/modifiers.rb

Instance Method Summary collapse

Constructor Details

#initialize(default_value) ⇒ Default


5
6
7
# File 'lib/livr/rules/modifiers.rb', line 5

def initialize(default_value)
  @default_value = default_value
end

Instance Method Details

#call(value, user_data, field_results) ⇒ Object


9
10
11
12
13
14
# File 'lib/livr/rules/modifiers.rb', line 9

def call(value, user_data, field_results)
  if is_no_value(value)
    field_results << @default_value
  end
  return
end