Module: Eson::API
- Includes:
- Chainable
- Included in:
- Shared::Aliases, Shared::Analyze, Shared::Bulk, Shared::ClearCache, Shared::CloseIndex, Shared::Count, Shared::CreateIndex, Shared::Delete, Shared::DeleteByQuery, Shared::DeleteIndex, Shared::DeleteMapping, Shared::DeleteTemplate, Shared::Flush, Shared::Get, Shared::GetMapping, Shared::GetSettings, Shared::GetTemplate, Shared::Health, Shared::Index, Shared::IndexExists, Shared::IndexStats, Shared::MoreLikeThis, Shared::MultiGet, Shared::MultiSearch, Shared::Nodes, Shared::OpenIndex, Shared::Optimize, Shared::Percolate, Shared::PutMapping, Shared::PutTemplate, Shared::Refresh, Shared::Search, Shared::Segments, Shared::Shutdown, Shared::SimpleSearch, Shared::Snapshot, Shared::State, Shared::Stats, Shared::Status, Shared::UpdateSettings
- Defined in:
- lib/eson/api.rb
Instance Method Summary collapse
- #multi_index(bool) ⇒ Object
- #multi_types(bool) ⇒ Object
- #no_indices(bool) ⇒ Object
- #parameters(*params) ⇒ Object
- #register(mod) ⇒ Object
-
#source_param(*params) ⇒ Object
Designates the name of the parameter that will be used as the body of the request.
Methods included from Chainable
Instance Method Details
#multi_index(bool) ⇒ Object
41 42 43 44 45 |
# File 'lib/eson/api.rb', line 41 def multi_index(bool) define_method :multi_index do bool end end |
#multi_types(bool) ⇒ Object
47 48 49 50 51 |
# File 'lib/eson/api.rb', line 47 def multi_types(bool) define_method :multi_types do bool end end |
#no_indices(bool) ⇒ Object
53 54 55 56 57 |
# File 'lib/eson/api.rb', line 53 def no_indices(bool) define_method :no_indices do bool end end |
#parameters(*params) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/eson/api.rb', line 5 def parameters(*params) chainable do define_method :parameters do super() + params end params.each do |p| attr_accessor p end end end |
#register(mod) ⇒ Object
59 60 61 |
# File 'lib/eson/api.rb', line 59 def register(mod) include(mod) end |
#source_param(*params) ⇒ Object
Designates the name of the parameter that will be used as the body of the request. Use only if the API has such a parameter (e.g. Search). You still have to list this parameter.
If multiple parameters are given, they will act as the keys in the sent JSON object.
31 32 33 34 35 36 37 38 39 |
# File 'lib/eson/api.rb', line 31 def source_param(*params) if params.length == 1 params = params.first end define_method :source_param do params end end |