Class: Mead::Extractor

Inherits:
Object
  • Object
show all
Defined in:
lib/mead/extractor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mead) ⇒ Extractor

a stack contains the data (unittitle, unitdate) from the identifier’s container all the way through to parent containers. The order is from most specific to least specific



9
10
11
12
13
# File 'lib/mead/extractor.rb', line 9

def initialize(mead)
  @stack = []
  get_mead_obj(mead)
  self
end

Instance Attribute Details

#docObject

Returns the value of attribute doc.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def doc
  @doc
end

#dscObject

Returns the value of attribute dsc.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def dsc
  @dsc
end

#ead_locationObject

Returns the value of attribute ead_location.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def ead_location
  @ead_location
end

#meadObject

Returns the value of attribute mead.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def mead
  @mead
end

#nodeObject

Returns the value of attribute node.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def node
  @node
end

#seriesObject

Returns the value of attribute series.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def series
  @series
end

#stackObject

Returns the value of attribute stack.



4
5
6
# File 'lib/mead/extractor.rb', line 4

def stack
  @stack
end

Instance Method Details

#extractObject



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

def extract
  get_ead_location
  eadxml = get_eadxml
  @doc = Nokogiri::XML(eadxml)
  do_extraction
  @mead. = @stack # make sure the metadata always gets cached to the identifier
  return @stack
end