Skip to content

Instantly share code, notes, and snippets.

@b4ldr
Last active February 9, 2018 14:39
Show Gist options
  • Save b4ldr/143d4589daaa5405f63814819d0dc003 to your computer and use it in GitHub Desktop.
Save b4ldr/143d4589daaa5405f63814819d0dc003 to your computer and use it in GitHub Desktop.
# This class foos a hash.
#
# @example format:
# class {'hash_foo':
# foo => {
# 'acquaintance_name' => {
# 'command' => '/path/to/command',
# 'frequency' => 'rarely',
# 'oneoff' => true,
# }
# }
#
# @param foo The hash to be food.
# @param bar Where to meet.
#
class hash_foo (
Hash $foo,
String $bar = 'Cheers',
) {
# ...
}
# This class foos a hash.
#
# @example format:
# class {'hash_foo':
# foo => {
# 'acquaintance_name' => {
# 'command' => '/path/to/command',
# 'frequency' => 'rarely',
# 'oneoff' => true,
# }
# }
#
# @param foo The hash to be food.
# @param bar Where to meet.
#
class hash_foo (
Hash[String, Hash_foo::Foo] $foo,
String $bar = 'Cheers',
) {
# ...
}
type Hash_foo::Foo = Struct[{
$command => Stdlib::Absolutepath,
$frequency => Enum['rarely', 'always'],
$oneoff => Boolean,
}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment