Sha256: a314831aee8f831ba30b689597cddbfd1f380e54872f764336742c69bc465292

Contents?: true

Size: 866 Bytes

Versions: 11

Compression:

Stored size: 866 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 to_s = "#{cache} #{config} #{data} #{state}"

    alias to_str to_s

    def inspect = "#<#{self.class}:#{object_id} #{self}>"

    private

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
xdg-8.10.0 lib/xdg/environment.rb
xdg-8.9.0 lib/xdg/environment.rb
xdg-8.8.0 lib/xdg/environment.rb
xdg-8.7.0 lib/xdg/environment.rb
xdg-8.6.0 lib/xdg/environment.rb
xdg-8.5.0 lib/xdg/environment.rb
xdg-8.4.1 lib/xdg/environment.rb
xdg-8.3.0 lib/xdg/environment.rb
xdg-8.2.0 lib/xdg/environment.rb
xdg-8.1.0 lib/xdg/environment.rb
xdg-8.0.0 lib/xdg/environment.rb