Class: XDG::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/xdg/environment.rb

Overview

A convenience wrapper to all XDG functionality.

Instance Method Summary collapse

Constructor Details

#initialize(home: Paths::Home, directories: Paths::Directory, environment: ENV) ⇒ Environment

Returns a new instance of Environment.



6
7
8
9
10
11
12
# File 'lib/xdg/environment.rb', line 6

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:)
  freeze
end

Instance Method Details

#cache_homeObject



14
# File 'lib/xdg/environment.rb', line 14

def cache_home = cache.home

#config_dirsObject



18
# File 'lib/xdg/environment.rb', line 18

def config_dirs = config.directories

#config_homeObject



16
# File 'lib/xdg/environment.rb', line 16

def config_home = config.home

#data_dirsObject



22
# File 'lib/xdg/environment.rb', line 22

def data_dirs = data.directories

#data_homeObject



20
# File 'lib/xdg/environment.rb', line 20

def data_home = data.home

#inspectObject



30
# File 'lib/xdg/environment.rb', line 30

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

#state_homeObject



24
# File 'lib/xdg/environment.rb', line 24

def state_home = state.home

#to_sObject Also known as: to_str



26
# File 'lib/xdg/environment.rb', line 26

def to_s = "#{cache} #{config} #{data} #{state}"