Class: Expedite::Syntax::DSL

Inherits:
Object
  • Object
show all
Defined in:
lib/expedite/syntax.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.run(&block) ⇒ Object



21
22
23
# File 'lib/expedite/syntax.rb', line 21

def self.run(&block)
  new.instance_eval(&block)
end

Instance Method Details

#action(name, &block) ⇒ Object



11
12
13
# File 'lib/expedite/syntax.rb', line 11

def action(name, &block)
  Expedite::Actions.register(name, &block)
end

#agent(name, parent: nil, &block) ⇒ Object



15
16
17
18
19
# File 'lib/expedite/syntax.rb', line 15

def agent(name, parent:nil, &block)
  agent = Expedite::Agents.register(name, parent: parent)
  agent.instance_eval(&block) if !block.nil?
  agent
end