Sha256: 035ef0846c13fd9084595fa7dbeda1b14e994a3a38598677c37e768b6e8618c8

Contents?: true

Size: 819 Bytes

Versions: 7

Compression:

Stored size: 819 Bytes

Contents

# frozen_string_literal: true

module XDG
  # A convenience wrapper to all XDG functionality.
  class Environment
    def initialize home: Paths::Home, directories: Paths::Directory, environment: ENV
      @cache = Cache.new(home:, directories:, environment:)
      @config = Config.new(home:, directories:, environment:)
      @data = Data.new(home:, directories:, environment:)
      @state = State.new home:, directories:, environment:
    end

    def cache_home = cache.home

    def config_home = config.home

    def config_dirs = config.directories

    def data_home = data.home

    def data_dirs = data.directories

    def state_home = state.home

    def inspect = "#{cache.inspect} #{config.inspect} #{data.inspect} #{state.inspect}"

    private

    attr_reader :cache, :config, :data, :state
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
xdg-7.0.3 lib/xdg/environment.rb
xdg-7.0.2 lib/xdg/environment.rb
xdg-7.0.1 lib/xdg/environment.rb
xdg-7.0.0 lib/xdg/environment.rb
xdg-6.6.2 lib/xdg/environment.rb
xdg-6.6.1 lib/xdg/environment.rb
xdg-6.6.0 lib/xdg/environment.rb