Class: Arel::Visitors::ProcWithSource

Inherits:
Object
  • Object
show all
Defined in:
lib/arel/visitors/ruby.rb

Instance Method Summary collapse

Constructor Details

#initialize(source, &block) ⇒ ProcWithSource

Returns a new instance of ProcWithSource.



301
302
303
# File 'lib/arel/visitors/ruby.rb', line 301

def initialize(source, &block)
  @source, @block = source, block
end

Instance Method Details

#call(*args) ⇒ Object



305
306
307
# File 'lib/arel/visitors/ruby.rb', line 305

def call(*args)
  @block.call(*args)
end

#to_sourceObject



309
310
311
# File 'lib/arel/visitors/ruby.rb', line 309

def to_source
  @source
end