# class Puppet::Resource::Status

### Constants

STATES
YAML_ATTRIBUTES

### Attributes

change_count[R]
current_values[RW]
default_log_level[R]
evaluation_time[RW]
file[RW]
line[RW]
node[RW]
out_of_sync_count[R]
resource[RW]
resource_type[R]
source_description[R]
status[RW]
time[R]
title[R]

### Public Class Methods

new(resource) click to toggle source

    # File lib/puppet/resource/status.rb, line 50
    def initialize(resource)
      @source_description = resource.path
      @resource = resource.to_s
      @change_count = 0
      @out_of_sync_count = 0
      @changed = false
      @out_of_sync = false
      @skipped = false
      @failed = false

      @file = resource.file
      @line = resource.line

      tag(*resource.tags)
      @time = Time.now
      @events = []
      @resource_type = resource.type.to_s.capitalize
      @title = resource.title
    end

### Public Instance Methods

<<(event) click to toggle source

    # File lib/puppet/resource/status.rb, line 27
    def <<(event)
      add_event(event)
      self
    end

add_event(event) click to toggle source

    # File lib/puppet/resource/status.rb, line 32
    def add_event(event)
      @events << event
      if event.status == 'failure'
        self.failed = true
      elsif event.status == 'success'
        @change_count += 1
        @changed = true
      end
      if event.status != 'audit'
        @out_of_sync_count += 1
        @out_of_sync = true
      end
    end

events() click to toggle source

    # File lib/puppet/resource/status.rb, line 46
    def events
      @events
    end

to_yaml_properties() click to toggle source

    # File lib/puppet/resource/status.rb, line 70
    def to_yaml_properties
      YAML_ATTRIBUTES & instance_variables
    end