Class: DhEasy::Qa::ValidateValue

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/dh_easy/qa/validate_value.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers

#add_errored_item, #evaluate_condition, #pass_if?

Constructor Details

#initialize(data_hash, field_to_validate, params, errored_item) ⇒ ValidateValue

Returns a new instance of ValidateValue.



8
9
10
11
12
13
# File 'lib/dh_easy/qa/validate_value.rb', line 8

def initialize(data_hash, field_to_validate, params, errored_item)
  @data_hash = data_hash
  @field_to_validate = field_to_validate
  @params = params
  @errored_item = errored_item
end

Instance Attribute Details

#data_hashObject (readonly)

Returns the value of attribute data_hash.



6
7
8
# File 'lib/dh_easy/qa/validate_value.rb', line 6

def data_hash
  @data_hash
end

#errored_itemObject (readonly)

Returns the value of attribute errored_item.



6
7
8
# File 'lib/dh_easy/qa/validate_value.rb', line 6

def errored_item
  @errored_item
end

#field_to_validateObject (readonly)

Returns the value of attribute field_to_validate.



6
7
8
# File 'lib/dh_easy/qa/validate_value.rb', line 6

def field_to_validate
  @field_to_validate
end

#paramsObject (readonly)

Returns the value of attribute params.



6
7
8
# File 'lib/dh_easy/qa/validate_value.rb', line 6

def params
  @params
end

Instance Method Details

#runObject



15
16
17
# File 'lib/dh_easy/qa/validate_value.rb', line 15

def run
  if_exists? ? handle_if : main_value_check
end