Class: Runcom::Context

Inherits:
Struct
  • 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(*arguments) ⇒ Context

Returns a new instance of Context.



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

def initialize *arguments
  super

  self[:home] ||= Paths::Home
  self[:environment] ||= ENV
  self[:xdg] = xdg.new home: home, environment: environment if xdg
end

Instance Attribute Details

#defaultsObject

Returns the value of attribute defaults

Returns:

  • (Object)

    the current value of defaults



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

def defaults
  @defaults
end

#environmentObject

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

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

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