Class: Elasticshell::Scopes::Mapping
- Inherits:
-
Elasticshell::Scope
- Object
- Elasticshell::Scope
- Elasticshell::Scopes::Mapping
- Includes:
- HasName
- Defined in:
- lib/elasticshell/scopes/mapping.rb
Constant Summary
Constants included from HasName
Constants included from HasVerb
Instance Attribute Summary collapse
-
#index ⇒ Object
Returns the value of attribute index.
Attributes included from HasName
Attributes inherited from Elasticshell::Scope
#client, #last_refresh_at, #path, #scopes
Class Method Summary collapse
Instance Method Summary collapse
- #exists? ⇒ Boolean
-
#initialize(index, name, options = {}) ⇒ Mapping
constructor
A new instance of Mapping.
Methods inherited from Elasticshell::Scope
#completing_scope_path_and_prefix, #completion_proc, #fetch_scopes, #initial_scopes, #refresh, #refresh!, #refreshed?, #request_names, #requests, #requests_matching, #reset!, #scopes_matching, #to_s
Methods included from HasVerb
Constructor Details
#initialize(index, name, options = {}) ⇒ Mapping
Returns a new instance of Mapping.
11 12 13 14 15 |
# File 'lib/elasticshell/scopes/mapping.rb', line 11 def initialize index, name, ={} self.index = index self.name = name super("/#{index.name}/#{self.name}", ) end |
Instance Attribute Details
#index ⇒ Object
Returns the value of attribute index.
9 10 11 |
# File 'lib/elasticshell/scopes/mapping.rb', line 9 def index @index end |
Class Method Details
.requests ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/elasticshell/scopes/mapping.rb', line 17 def self.requests @requests ||= { "GET" => { "_search" => "Search records within this mapping.", "_mapping" => "Retrieve the mapping settings for this mapping.", "_count" => "Count records within this mapping.", } } end |
Instance Method Details
#exists? ⇒ Boolean
27 28 29 30 |
# File 'lib/elasticshell/scopes/mapping.rb', line 27 def exists? index.refresh index.scopes.include?(name) end |