pakyow-presenter/lib/presenter/views.rb in pakyow-presenter-0.7.0 vs pakyow-presenter/lib/presenter/views.rb in pakyow-presenter-0.7.1
- old
+ new
@@ -10,11 +10,11 @@
def each
@views.each { |v| yield(v) }
end
def in_context(&block)
- ViewContext.new(self).instance_eval(&block)
+ ViewContext.new(self).instance_exec(self, &block)
end
def attributes(*args)
self.each {|e| e.attributes(*args)}
return self
@@ -100,12 +100,13 @@
def bind(object, opts = {})
self.each {|e| e.bind(object, opts)}
end
- def find(element)
+ def find(element, &block)
views = Views.new
self.each {|e| e.find(element, &block).each { |v| views << v }}
+ views
end
end
end
end