Class: SBF::Client::Person::Policies
- Inherits:
-
BaseEntity
- Object
- BaseEntity
- SBF::Client::Person::Policies
- Defined in:
- lib/stbaldricks/entities/person.rb
Constant Summary collapse
- BACKGROUND_CHECK_YEARS_VALID =
5
Constants inherited from BaseEntity
Instance Attribute Summary collapse
-
#background_check_date ⇒ Object
Returns the value of attribute background_check_date.
-
#background_check_url ⇒ Object
Returns the value of attribute background_check_url.
-
#is_photo_policy_accepted ⇒ Object
Returns the value of attribute is_photo_policy_accepted.
Attributes inherited from BaseEntity
Instance Method Summary collapse
Methods inherited from BaseEntity
allow_instantiation?, attr_accessor, attr_reader, attr_writer, collection_attributes, defined_attributes, #destroyed?, #dirty_data, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, #error, inherited, #initialize, #keys_hash, #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?, #reload!, #reload_recursive, #rollback!, #to_hash, #to_json, #to_partial
Methods included from EntityResponseConcern
#add_errors, #data, #error?, #errors?, #errors_http_code=, #http_code, #success?
Constructor Details
This class inherits a constructor from SBF::Client::BaseEntity
Instance Attribute Details
#background_check_date ⇒ Object
Returns the value of attribute background_check_date.
96 97 98 |
# File 'lib/stbaldricks/entities/person.rb', line 96 def background_check_date @background_check_date end |
#background_check_url ⇒ Object
Returns the value of attribute background_check_url.
96 97 98 |
# File 'lib/stbaldricks/entities/person.rb', line 96 def background_check_url @background_check_url end |
#is_photo_policy_accepted ⇒ Object
Returns the value of attribute is_photo_policy_accepted.
95 96 97 |
# File 'lib/stbaldricks/entities/person.rb', line 95 def is_photo_policy_accepted @is_photo_policy_accepted end |
Instance Method Details
#background_check_valid_at_date?(check_date) ⇒ Boolean
98 99 100 101 102 103 104 |
# File 'lib/stbaldricks/entities/person.rb', line 98 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 |