Class: Textminer::Mined

Inherits:
Object
  • Object
show all
Defined in:
lib/textminer/mined.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, path, type) ⇒ Mined

Returns a new instance of Mined.



13
14
15
16
17
# File 'lib/textminer/mined.rb', line 13

def initialize(url, path, type)
  self.url = url
  self.path = path
  self.type = type
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



10
11
12
# File 'lib/textminer/mined.rb', line 10

def path
  @path
end

#typeObject

Returns the value of attribute type.



11
12
13
# File 'lib/textminer/mined.rb', line 11

def type
  @type
end

#urlObject

Returns the value of attribute url.



9
10
11
# File 'lib/textminer/mined.rb', line 9

def url
  @url
end

Instance Method Details

#parseObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/textminer/mined.rb', line 19

def parse
  case self.type
  when 'xml'
    parse_xml(self.path)
  when 'plain'
    parse_plain(self.path)
  when 'pdf'
    parse_pdf(self.path)
  end
end