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

Version Path
miam-0.2.5.beta1 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta18 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta17 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta16 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta15 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta14 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta13 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta12 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta11 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta10 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta9 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta8 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta7 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta6 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta5 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta4 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta3 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta2 lib/miam/dsl/context/managed_policy.rb
miam-0.2.4.beta lib/miam/dsl/context/managed_policy.rb