Class: ESBify::Strategy

Inherits:
Base
  • Object
show all
Defined in:
lib/ESBify/strategy.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

TODO: There can be more then one transstatement per element, use lists for this



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

def defaults
  {
    "main" => "",
    "expectation" => ""
  }
end

#to_xmlObject



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

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

#xml_section(b, sect) ⇒ Object



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

def xml_section(b, sect)
  b.main do |b|
    b.transStatement sect["main"]
  end
  b.expectation do |b|
    b.transStatement sect["expectation"]
  end
end