Module: Phlexi::Form::Options::Min

Included in:
Builder
Defined in:
lib/phlexi/form/options/min.rb

Instance Method Summary collapse

Instance Method Details

#min(min_value = nil) ⇒ Object



7
8
9
10
11
12
13
14
# File 'lib/phlexi/form/options/min.rb', line 7

def min(min_value = nil)
  if min_value.nil?
    options.fetch(:min) { options[:min] = calculate_min }
  else
    options[:min] = min_value
    self
  end
end