Class: Puppet::Status

Inherits:
Object show all
Extended by:
Indirector
Defined in:
lib/puppet/status.rb

Constant Summary

Constants included from Indirector

Indirector::BadNameRegexp

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Indirector

configure_routes, indirects

Constructor Details

#initialize(status = nil) ⇒ Status

Returns a new instance of Status.



9
10
11
# File 'lib/puppet/status.rb', line 9

def initialize( status = nil )
  @status = status || {"is_alive" => true}
end

Instance Attribute Details

#statusObject

Returns the value of attribute status.



7
8
9
# File 'lib/puppet/status.rb', line 7

def status
  @status
end

Class Method Details

.from_data_hash(data) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/puppet/status.rb', line 17

def self.from_data_hash(data)
  if data.include?('status')
    self.new(data['status'])
  else
    self.new(data)
  end
end

Instance Method Details

#nameObject



25
26
27
# File 'lib/puppet/status.rb', line 25

def name
  "status"
end

#name=(name) ⇒ Object



29
30
31
# File 'lib/puppet/status.rb', line 29

def name=(name)
  # NOOP
end

#to_data_hashObject



13
14
15
# File 'lib/puppet/status.rb', line 13

def to_data_hash
  @status
end

#versionObject



33
34
35
# File 'lib/puppet/status.rb', line 33

def version
  @status['version']
end

#version=(version) ⇒ Object



37
38
39
# File 'lib/puppet/status.rb', line 37

def version=(version)
  @status['version'] = version
end