# frozen_string_literal: true class Tynn module Environment def self.setup(app, env: ENV["RACK_ENV"]) app.set(:environment, (env || :development).to_sym) end module ClassMethods def configure(*envs) yield(self) if envs.include?(environment) end def environment settings[:environment] end def development? environment == :development end def test? environment == :test end def production? environment == :production end def staging? environment == :staging end end end end