Class: Runcom::Context

Inherits:
Data
  • Object
show all
Defined in:
lib/runcom/context.rb

Overview

A common context for all XDG custom objects.

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#environmentObject (readonly)

Returns the value of attribute environment

Returns:

  • (Object)

    the current value of environment



5
6
7
# File 'lib/runcom/context.rb', line 5

def environment
  @environment
end

#homeObject (readonly)

Returns the value of attribute home

Returns:

  • (Object)

    the current value of home



5
6
7
# File 'lib/runcom/context.rb', line 5

def home
  @home
end

#xdgObject (readonly)

Returns the value of attribute xdg

Returns:

  • (Object)

    the current value of xdg



5
6
7
# File 'lib/runcom/context.rb', line 5

def xdg
  @xdg
end