Sha256: 871e7f7604b921356848bce0c078a25f5c1dfda84c597fc0342b1793592b4616

Contents?: true

Size: 638 Bytes

Versions: 13

Compression:

Stored size: 638 Bytes

Contents

class BaseBinding
  attr_accessor :target, :context, :binding_name

  def initialize(target, context, binding_name)
    @target = target
    @context = context
    @binding_name = binding_name

    @@binding_number ||= 10000
  end

  def section
    @section ||= target.section(@binding_name)
  end
  
  def remove
    section.remove
  end
  
  def remove_anchors
    section.remove_anchors
  end
  
  def queue_update
    if Volt.server?
      # Run right away
      update
    else
      
    end
  end
  
  def value_from_getter(getter)
    # Evaluate the getter proc in the context
    return @context.instance_eval(&getter)
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
volt-0.3.7 lib/volt/templates/base_binding.rb
volt-0.3.6 lib/volt/templates/base_binding.rb
volt-0.3.5 lib/volt/templates/base_binding.rb
volt-0.3.4 lib/volt/templates/base_binding.rb
volt-0.3.3 lib/volt/templates/base_binding.rb
volt-0.3.2 lib/volt/templates/base_binding.rb
volt-0.3.1 lib/volt/templates/base_binding.rb
volt-0.3.0 lib/volt/templates/base_binding.rb
volt-0.2.9 lib/volt/templates/base_binding.rb
volt-0.2.7 lib/volt/templates/base_binding.rb
volt-0.2.5 lib/volt/templates/base_binding.rb
volt-0.2.4 lib/volt/templates/base_binding.rb
volt-0.2.3 lib/volt/templates/base_binding.rb