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



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

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 = ({
    :operator => a0 || "==",
    :rule_key => reference_identifier}.merge(a1 || {}))
  context[:validation].validation_conditions << context[:validation_condition] = self
end