Class: Tika::Client
Constant Summary
Constants included from Requests
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Class Method Summary collapse
Instance Method Summary collapse
- #get_detectors ⇒ Object
- #get_metadata(opts = {}) ⇒ Object
- #get_mime_types ⇒ Object
- #get_parsers ⇒ Object
- #get_parsers_details ⇒ Object
- #get_text(opts = {}) ⇒ Object
- #get_version ⇒ Object
-
#initialize(opts = {}) ⇒ Client
constructor
A new instance of Client.
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
#host ⇒ Object (readonly)
Returns the value of attribute host.
20 21 22 |
# File 'lib/tika/client.rb', line 20 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
20 21 22 |
# File 'lib/tika/client.rb', line 20 def port @port end |
Class Method Details
.config ⇒ Object
11 12 13 |
# File 'lib/tika/client.rb', line 11 def config @config ||= Configuration.new end |
.configure {|config| ... } ⇒ Object
15 16 17 |
# File 'lib/tika/client.rb', line 15 def configure yield config end |
Instance Method Details
#get_detectors ⇒ Object
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_types ⇒ Object
39 40 41 |
# File 'lib/tika/client.rb', line 39 def get_mime_types GetMimeTypesRequest.execute(connection) end |
#get_parsers ⇒ Object
43 44 45 |
# File 'lib/tika/client.rb', line 43 def get_parsers GetParsersRequest.execute(connection) end |
#get_parsers_details ⇒ Object
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_version ⇒ Object
35 36 37 |
# File 'lib/tika/client.rb', line 35 def get_version GetVersionRequest.execute(connection) end |