Class: Labimotion::ApplicationEntity
- Inherits:
-
Grape::Entity
- Object
- Grape::Entity
- Labimotion::ApplicationEntity
- Defined in:
- lib/labimotion/entities/application_entity.rb
Overview
ApplicationEntity
Direct Known Subclasses
DatasetEntity, ElementRevisionEntity, ElnElementEntity, GenericEntity, GenericKlassEntity, GenericPublicEntity, KlassRevisionEntity, PropertiesEntity, SegmentRevisionEntity
Defined Under Namespace
Classes: MissingCurrentUserError
Constant Summary collapse
- CUSTOM_ENTITY_OPTIONS =
%i[anonymize_below anonymize_with].freeze
Class Method Summary collapse
- .expose!(*args) ⇒ Object
-
.expose_timestamps(timestamp_fields: %i[created_at updated_at],, **additional_args) ⇒ Object
rubocop:enable Metrics/MethodLength.
Class Method Details
.expose!(*args) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/labimotion/entities/application_entity.rb', line 12 def self.expose!(*args) fields = args.first = args.last.is_a?(Hash) ? args.pop : {} = () # merges additional params set in #with_options expose_fields_with_anonymization!(fields, ) end |
.expose_timestamps(timestamp_fields: %i[created_at updated_at],, **additional_args) ⇒ Object
rubocop:enable Metrics/MethodLength
41 42 43 44 45 |
# File 'lib/labimotion/entities/application_entity.rb', line 41 def self.(timestamp_fields: %i[created_at updated_at], **additional_args) .each do |field| expose field, format_with: :eln_timestamp, **additional_args end end |