Class: XDG::Paths::Home
- Inherits:
-
Object
- Object
- XDG::Paths::Home
- Extended by:
- Forwardable
- Defined in:
- lib/xdg/paths/home.rb
Overview
A XDG home path.
Constant Summary collapse
- KEY =
"HOME"
Instance Method Summary collapse
- #default ⇒ Object
- #dynamic ⇒ Object
-
#initialize(pair, environment = ENV) ⇒ Home
constructor
A new instance of Home.
- #inspect ⇒ Object
- #to_s ⇒ Object (also: #to_str)
Constructor Details
#initialize(pair, environment = ENV) ⇒ Home
Returns a new instance of Home.
16 17 18 19 |
# File 'lib/xdg/paths/home.rb', line 16 def initialize pair, environment = ENV @pair = pair @environment = environment end |
Instance Method Details
#default ⇒ Object
21 |
# File 'lib/xdg/paths/home.rb', line 21 def default = String(value) |
#dynamic ⇒ Object
23 |
# File 'lib/xdg/paths/home.rb', line 23 def dynamic = String(environment[key]).then { |path| path.empty? ? default : (path) } |
#inspect ⇒ Object
29 |
# File 'lib/xdg/paths/home.rb', line 29 def inspect = "#<#{self.class}:#{object_id} #{self}>" |