Module: Phlexi::Form::Options::Pattern

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

Instance Method Summary collapse

Instance Method Details

#pattern(pattern = nil) ⇒ Object



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

def pattern(pattern = nil)
  if pattern.nil?
    options.fetch(:pattern) { options[:pattern] = calculate_pattern }
  else
    options[:pattern] = pattern
    self
  end
end