Class: XDG::Environment
- Inherits:
-
Object
- Object
- XDG::Environment
- Defined in:
- lib/xdg/environment.rb
Overview
A convenience wrapper to all XDG functionality.
Instance Method Summary collapse
- #cache_home ⇒ Object
- #config_dirs ⇒ Object
- #config_home ⇒ Object
- #data_dirs ⇒ Object
- #data_home ⇒ Object
-
#initialize(home: Paths::Home, directories: Paths::Directory, environment: ENV) ⇒ Environment
constructor
A new instance of Environment.
- #inspect ⇒ Object
- #state_home ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(home: Paths::Home, directories: Paths::Directory, environment: ENV) ⇒ Environment
Returns a new instance of Environment.
6 7 8 9 10 11 |
# 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: end |
Instance Method Details
#cache_home ⇒ Object
13 |
# File 'lib/xdg/environment.rb', line 13 def cache_home = cache.home |
#config_dirs ⇒ Object
17 |
# File 'lib/xdg/environment.rb', line 17 def config_dirs = config.directories |
#config_home ⇒ Object
15 |
# File 'lib/xdg/environment.rb', line 15 def config_home = config.home |
#data_dirs ⇒ Object
21 |
# File 'lib/xdg/environment.rb', line 21 def data_dirs = data.directories |
#data_home ⇒ Object
19 |
# File 'lib/xdg/environment.rb', line 19 def data_home = data.home |
#inspect ⇒ Object
29 |
# File 'lib/xdg/environment.rb', line 29 def inspect = "#<#{self.class}:#{object_id} #{self}>" |
#state_home ⇒ Object
23 |
# File 'lib/xdg/environment.rb', line 23 def state_home = state.home |
#to_s ⇒ Object Also known as: to_str
25 |
# File 'lib/xdg/environment.rb', line 25 def to_s = "#{cache} #{config} #{data} #{state}" |