Class: ESBify::Behavior

Inherits:
Base
  • Object
show all
Defined in:
lib/ESBify/behavior.rb

Instance Method Summary collapse

Methods inherited from Base

#<<, #initialize, #to_xml_partial

Constructor Details

This class inherits a constructor from ESBify::Base

Instance Method Details

#defaultsObject



5
6
7
8
9
10
11
12
# File 'lib/ESBify/behavior.rb', line 5

def defaults
  {
    "name" => rand(1000),
    "ctl" => "",
    "jason" => "",
    "action" => "",
  }
end

#to_xmlObject



26
27
28
29
30
31
32
33
# File 'lib/ESBify/behavior.rb', line 26

def to_xml
  b = Builder::XmlMarkup.new indent: 2
  b.instruct!
  b.declare! :DOCTYPE, :BehaviourSet, :SYSTEM, "esb-ji-jason/behaviours.dtd"
  b.BehaviourSet do |b|
    b << to_xml_partial
  end # ExpectationSet
end

#xml_section(b, sect) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/ESBify/behavior.rb', line 15

def xml_section(b, sect)
  b.behaviour name: sect["name"] do |b|
    b.condition do |b|
      b.ctl sect["ctl"]
      b.jason sect["jason"]
    end
    b.action sect["action"]
  end 
end