Class: Tika::Client

Inherits:
Object
  • Object
show all
Includes:
Requests
Defined in:
lib/tika/client.rb

Constant Summary

Constants included from Requests

Requests::GET, Requests::PUT

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}) ⇒ Client

Returns a new instance of Client.



22
23
24
25
# File 'lib/tika/client.rb', line 22

def initialize(opts={})
  @host = opts.fetch(:host, self.class.config.host)
  @port = opts.fetch(:port, self.class.config.port)
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



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

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



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

def port
  @port
end

Class Method Details

.configObject



11
12
13
# File 'lib/tika/client.rb', line 11

def config
  @config ||= Configuration.new
end

.configure {|config| ... } ⇒ Object

Yields:



15
16
17
# File 'lib/tika/client.rb', line 15

def configure
  yield config
end

Instance Method Details

#get_detectorsObject



51
52
53
# File 'lib/tika/client.rb', line 51

def get_detectors
  GetDetectorsRequest.execute(connection)
end

#get_metadata(opts = {}) ⇒ Object



31
32
33
# File 'lib/tika/client.rb', line 31

def (opts={})
  GetMetadataRequest.execute(connection, opts)
end

#get_mime_typesObject



39
40
41
# File 'lib/tika/client.rb', line 39

def get_mime_types
  GetMimeTypesRequest.execute(connection)
end

#get_parsersObject



43
44
45
# File 'lib/tika/client.rb', line 43

def get_parsers
  GetParsersRequest.execute(connection)
end

#get_parsers_detailsObject



47
48
49
# File 'lib/tika/client.rb', line 47

def get_parsers_details
  GetParsersDetailsRequest.execute(connection)
end

#get_text(opts = {}) ⇒ Object



27
28
29
# File 'lib/tika/client.rb', line 27

def get_text(opts={})
  GetTextRequest.execute(connection, opts)
end

#get_versionObject



35
36
37
# File 'lib/tika/client.rb', line 35

def get_version
  GetVersionRequest.execute(connection)
end