Method: Arrow::Applet.validator

Defined in:
lib/arrow/applet.rb

.validator(action, rules = {}) ⇒ Object

Set the validator rules for the specified action.



255
256
257
258
259
260
261
262
# File 'lib/arrow/applet.rb', line 255

def self::validator( action, rules={} )
	if action.is_a?( Hash ) && rules.empty?
		Arrow::Logger[ self ].debug "Assuming hash syntax for validation definition: %p" % [ action ]
		action, rules = *action.to_a.first
	end
	Arrow::Logger[ self ].debug "Defining validator for action %p with rules %p" % [ action, rules ]
	self.signature.validator_profiles[ action ] = rules
end