Class: Miam::DSL::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/miam/dsl/context.rb

Defined Under Namespace

Classes: Group, Role, User

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, options = {}, &block) ⇒ Context

Returns a new instance of Context.



10
11
12
13
14
15
# File 'lib/miam/dsl/context.rb', line 10

def initialize(path, options = {}, &block)
  @path = path
  @options = options
  @result = {:users => {}, :groups => {}, :roles => {}, :instance_profiles => {}}
  instance_eval(&block)
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



8
9
10
# File 'lib/miam/dsl/context.rb', line 8

def result
  @result
end

Class Method Details

.eval(dsl, path, options = {}) ⇒ Object



2
3
4
5
6
# File 'lib/miam/dsl/context.rb', line 2

def self.eval(dsl, path, options = {})
  self.new(path, options) {
    eval(dsl, binding, path)
  }
end