Class: Oncall::DSL::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/oncall/dsl/group.rb

Instance Method Summary collapse

Constructor Details

#initializeGroup

Returns a new instance of Group.



4
5
6
# File 'lib/oncall/dsl/group.rb', line 4

def initialize
  @reporter = Oncall::Core.reporter
end

Instance Method Details

#group(name = nil, &block) ⇒ Object



8
9
10
11
12
13
14
15
# File 'lib/oncall/dsl/group.rb', line 8

def group(name=nil, &block)
  if block_given?
    scenario = Oncall::DSL::Call.new
    scenario.instance_exec &block
  else
    @reporter.report_empty_group
  end
end