module Arel::Visitors::BindVisitor - arel-4.0.2 Documentation

# module Arel::Visitors::BindVisitor

### Public Class Methods

new(target) click to toggle source
Calls superclass method

    # File lib/arel/visitors/bind_visitor.rb, line 4
    def initialize target
      @block = nil
      super
    end

### Public Instance Methods

accept(node, &block) click to toggle source
Calls superclass method

    # File lib/arel/visitors/bind_visitor.rb, line 9
    def accept node, &block
      @block = block if block_given?
      super
    end

### Private Instance Methods

visit_Arel_Nodes_Assignment(o, a) click to toggle source
Calls superclass method

    # File lib/arel/visitors/bind_visitor.rb, line 16
    def visit_Arel_Nodes_Assignment o, a
      if o.right.is_a? Arel::Nodes::BindParam
        "#{visit o.left, a} = #{visit o.right, a}"
      else
        super
      end
    end

visit_Arel_Nodes_BindParam(o, a) click to toggle source
Calls superclass method

    # File lib/arel/visitors/bind_visitor.rb, line 24
    def visit_Arel_Nodes_BindParam o, a
      if @block
        @block.call
      else
        super
      end
    end