class Brainstem::DSL::HashBlockField
Constants
- EXECUTABLE_OPTIONS
Public Instance Methods
executable?()
click to toggle source
# File lib/brainstem/dsl/hash_block_field.rb, line 22 def executable? (options.keys & EXECUTABLE_OPTIONS).present? end
run_on(model, context, helper_instance = Object.new)
click to toggle source
# File lib/brainstem/dsl/hash_block_field.rb, line 7 def run_on(model, context, helper_instance = Object.new) evaluated_model = nil evaluated_model = evaluate_value_on(model, context, helper_instance) if executable? result = {} configuration.each do |field_name, field| next unless field.presentable?(model, context) model_for_field = (executable? && use_parent_value?(field)) ? evaluated_model : model result[field_name] = field.run_on(model_for_field, context, context[:helper_instance]) if model_for_field end result end