48
49
50
51
52
53
54
55
56
57
58
59
60
|
# File 'lib/moonrope/dsl/structure_dsl.rb', line 48
def condition(condition, description = nil, &block)
scope_dsl = self.class.new(@structure)
if condition.is_a?(Hash) && condition.size == 1
condition = {:authenticator => condition.first[0], :access_rule => condition.first[1]}
elsif condition.is_a?(Symbol)
condition = {:authenticator => :default, :access_rule => condition}
else
condition = {:block => condition, :description => description}
end
scope_dsl.conditions = [@conditions, condition].flatten
scope_dsl.groups = @groups
scope_dsl.instance_eval(&block)
end
|