Sha256: 93c3685f4775cbb2448bf7d55fc0d8a9fffcb07c01c60d747d7fedd2951c39c8

Contents?: true

Size: 566 Bytes

Versions: 8

Compression:

Stored size: 566 Bytes

Contents

# frozen_string_literal: true

require "forwardable"
require "xdg/pair"

module XDG
  # Provides state support.
  class State
    extend Forwardable

    HOME_PAIR = Pair["XDG_STATE_HOME", ".local/state"].freeze

    delegate %i[home directories all inspect] => :combined

    def initialize home: Paths::Home, directories: Paths::Directory, environment: ENV
      @combined = Paths::Combined.new home.new(HOME_PAIR, environment),
                                      directories.new(Pair.new, environment)
    end

    private

    attr_reader :combined
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
xdg-7.1.3 lib/xdg/state.rb
xdg-7.1.2 lib/xdg/state.rb
xdg-7.1.1 lib/xdg/state.rb
xdg-7.1.0 lib/xdg/state.rb
xdg-7.0.3 lib/xdg/state.rb
xdg-7.0.2 lib/xdg/state.rb
xdg-7.0.1 lib/xdg/state.rb
xdg-7.0.0 lib/xdg/state.rb