Class: SuggestGrid::SuggestGridClient
- Inherits:
-
Object
- Object
- SuggestGrid::SuggestGridClient
- Defined in:
- lib/suggest_grid/suggest_grid_client.rb
Instance Method Summary collapse
-
#action ⇒ ActionController
Singleton access to action controller.
-
#initialize(connection_url) ⇒ SuggestGridClient
constructor
Initializer with authentication and configuration parameters.
-
#metadata ⇒ MetadataController
Singleton access to metadata controller.
-
#recommendation ⇒ RecommendationController
Singleton access to recommendation controller.
-
#similarity ⇒ SimilarityController
Singleton access to similarity controller.
-
#type ⇒ TypeController
Singleton access to type controller.
Constructor Details
#initialize(connection_url) ⇒ SuggestGridClient
Initializer with authentication and configuration parameters
38 39 40 41 42 43 44 45 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 38 def initialize(connection_url) uri = URI(connection_url) Configuration.base_uri = "#{uri.scheme}://#{uri.host}:#{uri.port}#{uri.path}" unless uri.user.nil? Configuration.basic_auth_user_name = uri.user Configuration.basic_auth_password = uri.password end end |
Instance Method Details
#action ⇒ ActionController
Singleton access to action controller
15 16 17 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 15 def action ActionController.instance end |
#metadata ⇒ MetadataController
Singleton access to metadata controller
21 22 23 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 21 def MetadataController.instance end |
#recommendation ⇒ RecommendationController
Singleton access to recommendation controller
27 28 29 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 27 def recommendation RecommendationController.instance end |
#similarity ⇒ SimilarityController
Singleton access to similarity controller
33 34 35 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 33 def similarity SimilarityController.instance end |
#type ⇒ TypeController
Singleton access to type controller
9 10 11 |
# File 'lib/suggest_grid/suggest_grid_client.rb', line 9 def type TypeController.instance end |