Module: Elasticsearch::Resources::Configurable::InstanceMethods
- Defined in:
- lib/elasticsearch/resources/configurable.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
Instance Attribute Details
#settings ⇒ Object
Returns the value of attribute settings.
24 25 26 |
# File 'lib/elasticsearch/resources/configurable.rb', line 24 def settings @settings end |
Instance Method Details
#configure(&block) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/elasticsearch/resources/configurable.rb', line 42 def configure(&block) @settings = inherited_settings || default_settings settings.tap do |s| yield(s) if block_given? end end |
#default_settings ⇒ Object
26 27 28 29 30 31 |
# File 'lib/elasticsearch/resources/configurable.rb', line 26 def default_settings self.class.configuration.configuration_class&.new.tap do |s| defaults_block = self.class.configuration.defaults self.instance_exec(s, &defaults_block) if defaults_block end end |
#inherited_settings ⇒ Object
33 34 35 36 37 38 39 40 |
# File 'lib/elasticsearch/resources/configurable.rb', line 33 def inherited_settings inherit_block = self.class.configuration.inherit_from if inherit_block s = self.instance_exec(&inherit_block)&.dup else nil end end |