Class: Runcom::Context
- Inherits:
-
Data
- Object
- Data
- Runcom::Context
- Defined in:
- lib/runcom/context.rb
Overview
A common context for all XDG custom objects.
Instance Attribute Summary collapse
-
#environment ⇒ Object
readonly
Returns the value of attribute environment.
-
#home ⇒ Object
readonly
Returns the value of attribute home.
-
#xdg ⇒ Object
readonly
Returns the value of attribute xdg.
Instance Method Summary collapse
-
#initialize(home: Paths::Home, environment: ENV, xdg: nil) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(home: Paths::Home, environment: ENV, xdg: nil) ⇒ Context
Returns a new instance of Context.
6 7 8 9 |
# File 'lib/runcom/context.rb', line 6 def initialize home: Paths::Home, environment: ENV, xdg: nil computed_xdg = xdg.is_a?(Class) ? xdg.new(home:, environment:) : xdg super home:, environment:, xdg: computed_xdg end |
Instance Attribute Details
#environment ⇒ Object (readonly)
Returns the value of attribute environment
5 6 7 |
# File 'lib/runcom/context.rb', line 5 def environment @environment end |
#home ⇒ Object (readonly)
Returns the value of attribute home
5 6 7 |
# File 'lib/runcom/context.rb', line 5 def home @home end |
#xdg ⇒ Object (readonly)
Returns the value of attribute xdg
5 6 7 |
# File 'lib/runcom/context.rb', line 5 def xdg @xdg end |