Class: Elastictastic::Adapter
- Inherits:
-
Object
- Object
- Elastictastic::Adapter
- Includes:
- TransportMethods
- Defined in:
- lib/elastictastic/adapter.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Response
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(host, options = {}) ⇒ Adapter
constructor
A new instance of Adapter.
Methods included from TransportMethods
#delete, #get, #head, #post, #put
Constructor Details
#initialize(host, options = {}) ⇒ Adapter
Returns a new instance of Adapter.
19 20 21 22 23 |
# File 'lib/elastictastic/adapter.rb', line 19 def initialize(host, = {}) @host = host @request_timeout = [:request_timeout] @connect_timeout = [:connect_timeout] end |
Class Method Details
.[](str) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/elastictastic/adapter.rb', line 11 def self.[](str) case str when nil then NetHttpAdapter when /^[a-z_]+$/ then Elastictastic.const_get("#{str.to_s.classify}Adapter") else str.constantize end end |