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(parser) ⇒ RecordSpec

Returns a new instance of RecordSpec.



203
204
205
206
207
# File 'lib/athena/formats/xml.rb', line 203

def initialize(parser)
  super()

  @parser = parser
end

Instance Attribute Details

#parserObject (readonly)

Returns the value of attribute parser.



200
201
202
# File 'lib/athena/formats/xml.rb', line 200

def parser
  @parser
end

#recordObject

Returns the value of attribute record.



201
202
203
# File 'lib/athena/formats/xml.rb', line 201

def record
  @record
end

Instance Method Details

#done(context, name) ⇒ Object



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

def done(context, name)
  super

  record.close
end

#start(context, name, attrs) ⇒ Object



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

def start(context, name, attrs)
  super

  self.record = Athena::Record.new(parser.block)
end