Class: Athena::Formats::XML::RecordSpec

Inherits:
BaseSpec
  • Object
show all
Defined in:
lib/athena/formats/xml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from BaseSpec

#empty, #text

Constructor Details

#initialize(&block) ⇒ RecordSpec

Returns a new instance of RecordSpec.



210
211
212
213
# File 'lib/athena/formats/xml.rb', line 210

def initialize(&block)
  super()
  @block = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



207
208
209
# File 'lib/athena/formats/xml.rb', line 207

def block
  @block
end

#recordObject

Returns the value of attribute record.



208
209
210
# File 'lib/athena/formats/xml.rb', line 208

def record
  @record
end

Instance Method Details

#done(context, name) ⇒ Object



221
222
223
224
225
# File 'lib/athena/formats/xml.rb', line 221

def done(context, name)
  context = super
  record.close
  context
end

#start(context, name, attrs) ⇒ Object



215
216
217
218
219
# File 'lib/athena/formats/xml.rb', line 215

def start(context, name, attrs)
  context = super
  self.record = Athena::Record.new(nil, block, true)
  context
end