pakyow-presenter/lib/presenter/attributes.rb in pakyow-presenter-0.9.1 vs pakyow-presenter/lib/presenter/attributes.rb in pakyow-presenter-0.10.0

- old
+ new

@@ -47,10 +47,14 @@ end update_value end + def include?(attribute) + @doc.has_attribute?(attribute) + end + # passes method call to `value` def method_missing(method, *args) ret = @value.send(method, *args) update_value return ret @@ -180,10 +184,15 @@ def initialize @attributes = [] end def <<(attributes) - @attributes << attributes + if attributes.is_a?(Attribute) || attributes.is_a?(Attributes) + @attributes << attributes + else + method_missing(:<<, *attributes) + end + self end def each @attributes.each { |a| yield(a) }