Class: SBF::Client::Person::Policies

Inherits:
BaseEntity show all
Defined in:
lib/stbaldricks/entities/person.rb

Constant Summary collapse

BACKGROUND_CHECK_YEARS_VALID =
3

Constants inherited from BaseEntity

BaseEntity::ELSE

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#errors

Instance Method Summary collapse

Methods inherited from BaseEntity

#add_errors, allow_instantiation?, attr_accessor, attr_reader, attr_writer, attributes, #attributes=, collection_attributes, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, inherited, #initialize, #model_name, multitype_attr_accessor, multitype_attr_reader, multitype_attr_writer, multitype_collection_attr_accessor, multitype_collection_attr_reader, multitype_collection_attr_writer, #not_provided_attributes, optional_attributes, #persisted?, #to_hash, #to_json

Constructor Details

This class inherits a constructor from SBF::Client::BaseEntity

Instance Attribute Details

#background_check_dateObject

Returns the value of attribute background_check_date.



90
91
92
# File 'lib/stbaldricks/entities/person.rb', line 90

def background_check_date
  @background_check_date
end

#background_check_urlObject

Returns the value of attribute background_check_url.



90
91
92
# File 'lib/stbaldricks/entities/person.rb', line 90

def background_check_url
  @background_check_url
end

#is_photo_policy_acceptedObject

Returns the value of attribute is_photo_policy_accepted.



89
90
91
# File 'lib/stbaldricks/entities/person.rb', line 89

def is_photo_policy_accepted
  @is_photo_policy_accepted
end

Instance Method Details

#background_check_valid_at_date?(check_date) ⇒ Boolean

Returns:



92
93
94
95
96
97
# File 'lib/stbaldricks/entities/person.rb', line 92

def background_check_valid_at_date?(check_date)
  check_date = DateTime.parse(check_date) if check_date.is_a?(String)
  check_date = DateTime.parse(check_date.to_s) if check_date.is_a?(Date)
  check_date = DateTime.parse(check_date.strftime('%d/%m/%Y %H:%M:%S')) if check_date.is_a?(Time)
  background_check_date && check_date.is_a?(DateTime) && background_check_date > check_date.prev_year(SBF::Client::Person::Policies::BACKGROUND_CHECK_YEARS_VALID)
end