Module: SurveyorParserValidationConditionMethods

Defined in:
lib/surveyor/parser.rb

Overview

ValidationCondition model

Instance Method Summary collapse

Instance Method Details

#parse_and_build(context, args, original_method, reference_identifier) ⇒ Object



416
417
418
419
420
421
422
423
424
425
426
# File 'lib/surveyor/parser.rb', line 416

def parse_and_build(context, args, original_method, reference_identifier)
  # clear context
  context.delete :validation_condition

  # build and set context
  a0, a1 = args
  self.attributes = PermittedParams.new({
    :operator => a0 || "==",
    :rule_key => reference_identifier}.merge(a1 || {})).validation_condition
  context[:validation].validation_conditions << context[:validation_condition] = self
end