Class: Convoy::Setup::Configuration::Instance

Inherits:
Object
  • Object
show all
Defined in:
lib/convoy/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/convoy/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/convoy/setup/configuration/instance.rb', line 11

def data
  @data
end

#pathObject (readonly)

Returns the value of attribute path.



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

def path
  @path
end

Class Method Details

.blankObject



6
7
8
# File 'lib/convoy/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/convoy/setup/configuration/instance.rb', line 18

def blank?
    data.empty?
end

#globalObject



24
25
26
# File 'lib/convoy/setup/configuration/instance.rb', line 24

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

#userObject



28
29
30
# File 'lib/convoy/setup/configuration/instance.rb', line 28

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