Module: Elasticated::BlockEvaluation
- Included in:
- Aggregation, ConditionsBuilder, Document, FilterAggregationEvaluator, IndexSelector, Mapping::Builder, Mapping::FieldsBuilder, Query, QueryAggregations, RangeAggregationEvaluator, RangesBuilder
- Defined in:
- lib/elasticated/block_evaluation.rb
Instance Method Summary collapse
Instance Method Details
#evaluate(block = nil, obj = nil) ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/elasticated/block_evaluation.rb', line 4 def evaluate(block=nil, obj=nil) return unless block obj ||= self if block.parameters.empty? obj.instance_exec &block else block.call obj end end |