Class: ApiEngineBase::InboxService::Blast::Metadata

Inherits:
ServiceBase
  • Object
show all
Defined in:
app/services/api_engine_base/inbox_service/blast/metadata.rb

Constant Summary

Constants inherited from ServiceBase

ServiceBase::ON_ARGUMENT_VALIDATION

Instance Method Summary collapse

Methods inherited from ServiceBase

inherited, #internal_validate, #service_base_logging, #validate!

Methods included from ArgumentValidation

included

Methods included from ServiceLogging

#aletered_message, #class_name, #log, #log_error, #log_info, #log_prefix, #log_warn, #logger, #service_id

Instance Method Details

#callObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/services/api_engine_base/inbox_service/blast/metadata.rb', line 7

def call
  entities = ::MessageBlast.all.select(:id, :title, :existing_users, :new_users).map do |mb|
    ApiEngineBase::Schema::Inbox::MessageBlastEntity.new(
      title: mb.title,
      id: mb.id,
      existing_users: mb.existing_users,
      new_users: mb.new_users,
    )
  end


  context. = ApiEngineBase::Schema::Inbox::.new(
    entities: entities,
    count: entities.length,
  )
end