Module: Appydays::Configurable
- Included in:
- Amigo::DurableJob, Webhookdb, Webhookdb::AWS, Webhookdb::Async, Webhookdb::Async::Autoscaler, Webhookdb::Cloudflare, Webhookdb::ConnectionCache, Webhookdb::Convertkit, Webhookdb::Customer, Webhookdb::DatabaseDocument, Webhookdb::Dbutil, Webhookdb::DemoMode, Webhookdb::DeveloperAlert, Webhookdb::EmailOctopus, Webhookdb::Front, Webhookdb::Github, Webhookdb::GoogleCalendar, Webhookdb::Heroku, Webhookdb::Http, Webhookdb::Icalendar, Webhookdb::Increase, Webhookdb::IntegrationSpecHelpers, Webhookdb::Intercom, Webhookdb::LoggedWebhook, Webhookdb::Message, Webhookdb::Message::EmailTransport, Webhookdb::MicrosoftCalendar, Webhookdb::Nextpax, Webhookdb::Organization::Alerting, Webhookdb::Organization::DbBuilder, Webhookdb::Plaid, Webhookdb::Plivo, Webhookdb::Postgres::Maintenance, Webhookdb::Postgres::Model, Webhookdb::Postmark, Webhookdb::Redis, Webhookdb::Replicator, Webhookdb::Sentry, Webhookdb::Service, Webhookdb::Service::Auth, Webhookdb::Shopify, Webhookdb::Signalwire, Webhookdb::Slack, Webhookdb::Snowflake, Webhookdb::Sponsy, Webhookdb::Stripe, Webhookdb::Subscription, Webhookdb::SyncTarget, Webhookdb::Theranest, Webhookdb::Transistor, Webhookdb::Twilio, Webhookdb::Webterm
- Defined in:
- lib/webhookdb.rb
Class Method Summary collapse
Class Method Details
.fetch_env(keys, default = :__keyerror, env: ENV) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/webhookdb.rb', line 23 def self.fetch_env(keys, default=:__keyerror, env: ENV) keys = [keys] unless keys.respond_to?(:to_ary) keys.to_ary.each do |k| return env.fetch(k) if env.key?(k) end raise KeyError, "no key found in env: #{keys}" if default == :__keyerror return default end |