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, #inspect_spec, #text

Methods included from Util

#verbose

Constructor Details

#initialize(&block) ⇒ RecordSpec

Returns a new instance of RecordSpec.



212
213
214
215
216
# File 'lib/athena/formats/xml.rb', line 212

def initialize(&block)
  super()

  @block  = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



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

def block
  @block
end

#recordObject

Returns the value of attribute record.



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

def record
  @record
end

Instance Method Details

#done(context, name) ⇒ Object



224
225
226
227
228
# File 'lib/athena/formats/xml.rb', line 224

def done(context, name)
  super

  record.close
end

#start(context, name, attrs) ⇒ Object



218
219
220
221
222
# File 'lib/athena/formats/xml.rb', line 218

def start(context, name, attrs)
  super

  self.record = Athena::Record.new(nil, block, true)
end