Class: ESBify::Base

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

Direct Known Subclasses

Behavior, Expectation, Strategy

Instance Method Summary collapse

Constructor Details

#initializeBase

Returns a new instance of Base.



3
4
5
# File 'lib/ESBify/base.rb', line 3

def initialize
  @data = []
end

Instance Method Details

#<<(sects) ⇒ Object



11
12
13
14
15
# File 'lib/ESBify/base.rb', line 11

def <<(sects)
  @data += sects.map do |sect|
    defaults.merge(sect)
  end
end

#defaultsObject



7
8
9
# File 'lib/ESBify/base.rb', line 7

def defaults
  
end

#to_xml_partialObject



17
18
19
20
21
22
23
24
# File 'lib/ESBify/base.rb', line 17

def to_xml_partial
  b = Builder::XmlMarkup.new indent: 2, margin: 1
  @data.each do |sect|
    xml_section(b, sect)
  end
  #puts b.inspect
  "\n" + b.target!
end