Class: Stretch::Index
- Inherits:
-
Object
- Object
- Stretch::Index
- Defined in:
- lib/stretch/index.rb
Instance Attribute Summary collapse
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(name, connection) ⇒ Index
constructor
A new instance of Index.
- #open ⇒ Object
- #settings(options = {}) ⇒ Object
Constructor Details
#initialize(name, connection) ⇒ Index
Returns a new instance of Index.
5 6 7 8 9 10 |
# File 'lib/stretch/index.rb', line 5 def initialize name, connection raise ArgumentError if name.nil? || name.empty? @name = name @connection = connection end |
Instance Attribute Details
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
3 4 5 |
# File 'lib/stretch/index.rb', line 3 def connection @connection end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/stretch/index.rb', line 3 def name @name end |
Instance Method Details
#close ⇒ Object
24 25 26 |
# File 'lib/stretch/index.rb', line 24 def close post "/_close" end |
#open ⇒ Object
20 21 22 |
# File 'lib/stretch/index.rb', line 20 def open post "/_open" end |
#settings(options = {}) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/stretch/index.rb', line 12 def settings = {} if .any? put "/_settings", else get("/_settings")[@name]["settings"] end end |