Class: Escort::Setup::Configuration::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/escort/setup/configuration/instance.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, hash) ⇒ Instance

Returns a new instance of Instance.



13
14
15
16
# File 'lib/escort/setup/configuration/instance.rb', line 13

def initialize(path, hash)
  @data = hash
  @path = path
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



11
12
13
# File 'lib/escort/setup/configuration/instance.rb', line 11

def data
  @data
end

#pathObject (readonly)

Returns the value of attribute path.



11
12
13
# File 'lib/escort/setup/configuration/instance.rb', line 11

def path
  @path
end

Class Method Details

.blankObject



6
7
8
# File 'lib/escort/setup/configuration/instance.rb', line 6

def blank
  self.new(nil, {})
end

Instance Method Details

#blank?Boolean Also known as: empty?

Returns:

  • (Boolean)


18
19
20
# File 'lib/escort/setup/configuration/instance.rb', line 18

def blank?
  data.empty?
end

#globalObject



23
24
25
# File 'lib/escort/setup/configuration/instance.rb', line 23

def global
  data[:global] || {}
end

#userObject



27
28
29
# File 'lib/escort/setup/configuration/instance.rb', line 27

def user
  data[:user] || {}
end