def facts(node = @node, timestamp = false)
      raise "Expected @facts to be a hash but it is a #{@facts.class}" unless @facts.is_a?(Hash)
      raise "Expected @facts['values'] to be a hash but it is a #{@facts['values'].class}" unless @facts['values'].is_a?(Hash)
      f = @facts.dup
      f['name'] = node unless node.nil? || node.empty?
      f['values'].delete('_timestamp')
      f.delete('expiration')
      if timestamp
        f['timestamp'] = Time.now.to_s
        f['values']['timestamp'] = f['timestamp']
        f['expiration'] = (Time.now + (24 * 60 * 60)).to_s
      end
      f
    end
def facts(node = @node, timestamp = false)
      raise "Expected @facts to be a hash but it is a #{@facts.class}" unless @facts.is_a?(Hash)
      raise "Expected @facts['values'] to be a hash but it is a #{@facts['values'].class}" unless @facts['values'].is_a?(Hash)
      f = @facts.dup
      f['name'] = node unless node.nil? || node.empty?
      f['values'].delete('_timestamp')
      f.delete('expiration')
      if timestamp
        f['timestamp'] = Time.now.to_s
        f['values']['timestamp'] = f['timestamp']
        f['expiration'] = (Time.now + (24 * 60 * 60)).to_s
      end
      f
    end
Facts - returned the 'cleansed' facts.
 Clean up facts by setting 'name' to the node if given, and deleting _timestamp and expiration
 which may cause Puppet catalog compilation to fail if the facts are old.
 @param node [String] Node name to override returned facts
 @return [Hash] Facts hash { 'name' => '...', 'values' => { ... } }