Sha256: 1548021debe236f8e1682a4bc59149cc41d7b93c20fae00109481e6baf6c9e99
Contents?: true
Size: 682 Bytes
Versions: 708
Compression:
Stored size: 682 Bytes
Contents
require 'puppet/util/ldap' class Puppet::Util::Ldap::Generator # Declare the attribute we'll use to generate the value. def from(source) @source = source self end # Actually do the generation. def generate(value = nil) if value.nil? @generator.call else @generator.call(value) end end # Initialize our generator with the name of the parameter # being generated. def initialize(name) @name = name end def name @name.to_s end def source if @source @source.to_s else nil end end # Provide the code that does the generation. def with(&block) @generator = block self end end
Version data entries
708 entries across 708 versions & 6 rubygems