pakyow-presenter/lib/presenter/views.rb in pakyow-presenter-0.6.3.1 vs pakyow-presenter/lib/presenter/views.rb in pakyow-presenter-0.7.0
- old
+ new
@@ -63,20 +63,14 @@
def append(content)
self.each {|e| e.append(content)}
end
alias :render :append
-
- def +(val)
- self.each {|e| e + val}
- end
-
+
def <<(val)
if val.is_a? View
@views << val
- else
- self.each {|e| e << val}
end
end
def method_missing(method, *args)
if method.to_s.include?('=')
@@ -92,21 +86,21 @@
def id
method_missing(:id)
end
- def repeat_for(objects, &block)
+ def repeat_for(objects, opts = {}, &block)
first_found = self.first
# Remove other matches
self.drop(1).each {|found| found.remove}
# Repeat for first match
- first_found.repeat_for(objects, &block)
+ first_found.repeat_for(objects, opts, &block)
end
- def bind(object)
- self.each {|e| e.bind(object)}
+ def bind(object, opts = {})
+ self.each {|e| e.bind(object, opts)}
end
def find(element)
views = Views.new
self.each {|e| e.find(element, &block).each { |v| views << v }}