Module: Elasticated::Mixins::BlockEvaluation
- Included in:
- Aggregation, BulkRequest, ConditionsBuilder, Document, FilterAggregationEvaluator, IndexSelector, Elasticated::Mapping::Builder, Elasticated::Mapping::FieldsBuilder, Query, QueryAggregations, RangeAggregationEvaluator, RangesBuilder
- Defined in:
- lib/elasticated/mixins/block_evaluation.rb
Instance Method Summary collapse
Instance Method Details
#evaluate(block = nil, obj = nil) ⇒ Object
5 6 7 8 9 10 11 12 13 |
# File 'lib/elasticated/mixins/block_evaluation.rb', line 5 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 |