Class: ImzML::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/imzml/parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filepath, binary_filepath = nil) ⇒ Parser

Returns a new instance of Parser.



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/imzml/parser.rb', line 9

def initialize(filepath, binary_filepath = nil)

  sax = ImzML::Sax.new
  
  # If no external file were specified, behave like the file has the same name
  # as the metadata
  if binary_filepath.nil?
    name = filepath.split(".")[0..-2].join(".")
    binary_filepath = [name, "ibd"].join(".")
  end
  sax.binary_filepath = binary_filepath      

  # parse the XML
  Ox.sax_parse(sax, File.open(filepath))
  @metadata = sax.
  
end

Instance Attribute Details

#metadataObject (readonly)

Returns the value of attribute metadata.



7
8
9
# File 'lib/imzml/parser.rb', line 7

def 
  @metadata
end