# class Facts::Couch

### Public Instance Methods

find(request) click to toggle source

Return the facts object or nil if there is no document

Calls superclass method Puppet::Indirector::Couch#find

    # File lib/puppet/indirector/facts/couch.rb, line 9
    def find(request)
      doc = super
      doc ? model.new(doc['_id'], doc['facts']) : nil
    end

### Private Instance Methods

document_type_for(request) click to toggle source

Facts are stored to the 'node' document.

    # File lib/puppet/indirector/facts/couch.rb, line 24
    def document_type_for(request)
      'node'
    end

hash_from(request) click to toggle source

Facts values are stored to the document's 'facts' attribute. Hostname is stored to 'name'

Calls superclass method

    # File lib/puppet/indirector/facts/couch.rb, line 19
    def hash_from(request)
      super.merge('facts' => request.instance.values)
    end

id_for(request) click to toggle source

The id used to store the object in couchdb.

    # File lib/puppet/indirector/facts/couch.rb, line 29
    def id_for(request)
      request.key.to_s
    end