Class: Tika::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/tika/resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, opts = {}) ⇒ Resource

Returns a new instance of Resource.



6
7
8
9
10
# File 'lib/tika/resource.rb', line 6

def initialize(file, opts={})
  @file = file
  @app = App.new
  @opts = opts
end

Instance Attribute Details

#appObject (readonly)

Returns the value of attribute app.



4
5
6
# File 'lib/tika/resource.rb', line 4

def app
  @app
end

#fileObject (readonly)

Returns the value of attribute file.



4
5
6
# File 'lib/tika/resource.rb', line 4

def file
  @file
end

#optsObject (readonly)

Returns the value of attribute opts.



4
5
6
# File 'lib/tika/resource.rb', line 4

def opts
  @opts
end

Instance Method Details

#content_typeObject



20
21
22
# File 'lib/tika/resource.rb', line 20

def content_type
  @content_type ||= app.detect(file, opts)
end

#languageObject



24
25
26
# File 'lib/tika/resource.rb', line 24

def language
  @language ||= app.get_language(file, opts)
end

#metadataObject



16
17
18
# File 'lib/tika/resource.rb', line 16

def 
  @metadata ||= app.(file, opts)
end

#textObject



12
13
14
# File 'lib/tika/resource.rb', line 12

def text
  @text ||= app.get_text(file, opts)
end