class Rubble::Resource::Base

Attributes

name[R]

Public Class Methods

new(name, *params) click to toggle source
# File lib/rubble/resource/base.rb, line 10
def initialize(name, *params)
    @name = name
end

Public Instance Methods

get_filesets() click to toggle source
# File lib/rubble/resource/base.rb, line 28
def get_filesets
    []
end
get_version(filesets) click to toggle source
# File lib/rubble/resource/base.rb, line 18
def get_version(filesets)
    md = Digest::SHA1.new
    filesets.each do |fileset|
        fileset.paths.each do |path|
            md.file(path)
        end
    end
    md.hexdigest.force_encoding('UTF-8')
end
snapshot() click to toggle source
# File lib/rubble/resource/base.rb, line 32
def snapshot
    filesets = get_filesets
    version = get_version(filesets)
    Snapshot.new(version, *filesets)
end
to_s() click to toggle source
# File lib/rubble/resource/base.rb, line 38
def to_s
    to_yaml
end
type() click to toggle source
# File lib/rubble/resource/base.rb, line 14
def type
    self.class.name.split('::').last.downcase
end