Sha256: 90a1fd313a1139fb0624c627290363182813ffa3a8981ed7580f209e377ed8a9
Contents?: true
Size: 509 Bytes
Versions: 24
Compression:
Stored size: 509 Bytes
Contents
class Miam::DSL::Context::ManagedPolicy include Miam::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 end end
Version data entries
24 entries across 24 versions & 1 rubygems