Class: LucidWorks::Server
- Inherits:
-
Object
- Object
- LucidWorks::Server
- Includes:
- Associations
- Defined in:
- lib/lucid_works/server.rb
Overview
The LucidWorks::Server class is the starting point for access to a LucidWorks Solr search server.
Constant Summary collapse
- DEFAULT_REST_API_PATH =
"/api"
Instance Attribute Summary collapse
-
#host ⇒ Object
Returns the value of attribute host.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
- #crawler(name) ⇒ Object
-
#initialize(server_uri, options = {}) ⇒ Server
constructor
A new instance of Server.
-
#logs_url ⇒ Object
Location where raw log files may be retrieved.
- #solr_uri ⇒ Object
- #uri ⇒ Object (also: #rest_api_uri)
Constructor Details
#initialize(server_uri, options = {}) ⇒ Server
Returns a new instance of Server.
16 17 18 19 |
# File 'lib/lucid_works/server.rb', line 16 def initialize(server_uri, = {}) @host = server_uri @path = .delete(:path) || DEFAULT_REST_API_PATH end |
Instance Attribute Details
#host ⇒ Object
Returns the value of attribute host.
14 15 16 |
# File 'lib/lucid_works/server.rb', line 14 def host @host end |
#path ⇒ Object
Returns the value of attribute path.
14 15 16 |
# File 'lib/lucid_works/server.rb', line 14 def path @path end |
Instance Method Details
#crawler(name) ⇒ Object
26 27 28 |
# File 'lib/lucid_works/server.rb', line 26 def crawler(name) crawlers.detect { |c| c.name == name } end |
#logs_url ⇒ Object
Location where raw log files may be retrieved
35 36 37 |
# File 'lib/lucid_works/server.rb', line 35 def logs_url "#{host}/logs/" end |
#solr_uri ⇒ Object
30 31 32 |
# File 'lib/lucid_works/server.rb', line 30 def solr_uri "#{host}/solr/" end |
#uri ⇒ Object Also known as: rest_api_uri
21 22 23 |
# File 'lib/lucid_works/server.rb', line 21 def uri @host + @path end |