Class: CommandTower::Messaging::Execution::Adapters::Expo::Configuration

Inherits:
Object
  • Object
show all
Defined in:
app/services/command_tower/messaging/execution/adapters/expo/configuration.rb

Overview

Platform readiness detector for Expo Push delivery. Ready when transport adapter is fake, log, or http — disabled never counts. http does not require access_token (Expo default); Bearer is optional.

Constant Summary collapse

CONFIGURED_ADAPTERS =
%w[fake log http].freeze

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.expo_configured? ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 14

def self.expo_configured?
  new.expo_configured?
end

Instance Method Details

#access_token ⇒ Object



34
35
36
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 34

def access_token
  CommandTower.config.messaging.expo.access_token.to_s.strip
end

#adapter_name ⇒ Object



22
23
24
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 22

def adapter_name
  CommandTower.config.messaging.expo.adapter.to_s
end

#api_base_url ⇒ Object



26
27
28
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 26

def api_base_url
  CommandTower.config.messaging.expo.api_base_url.to_s.strip
end

#expo_configured? ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 18

def expo_configured?
  CONFIGURED_ADAPTERS.include?(adapter_name)
end

#timeout_seconds ⇒ Object



30
31
32
# File 'app/services/command_tower/messaging/execution/adapters/expo/configuration.rb', line 30

def timeout_seconds
  CommandTower.config.messaging.expo.timeout_seconds
end