Sha256: 2870b7fc8e0bd4ab1d974b61b74eb441c7b076c52a1c09a1612b1a57a70f9037
Contents?: true
Size: 533 Bytes
Versions: 4
Compression:
Stored size: 533 Bytes
Contents
class Subiam::DSL::Context::ManagedPolicy include Subiam::TemplateHelper def initialize(context, name, &block) @policy_name = name @context = context.merge(:policy_name => name) @result = {:document => get_document(block)} end attr_reader :result private def get_document(block) document = instance_eval(&block) unless document.kind_of?(Hash) raise "ManagedPolicy `#{@policy_name}`: wrong argument type #{document.class} (expected Hash)" end document.keys_to_s_recursive end end
Version data entries
4 entries across 4 versions & 1 rubygems