Module: Serega::SeregaPlugins::Formatters::AttributeInstanceMethods
- Defined in:
- lib/serega/plugins/formatters/formatters.rb
Instance Method Summary collapse
Instance Method Details
#value_block ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/serega/plugins/formatters/formatters.rb', line 43 def value_block return @value_block if instance_variable_defined?(:@value_block) original_block = super formatter = opts[:format] return original_block unless formatter new_value_block = formatted_block(formatter, original_block) # Detect formatted :const value in advance if opts.key?(:const) const_value = new_value_block.call new_value_block = proc { const_value } end @value_block = new_value_block end |