Class Ambling::Data::BaseValueHolder
In: lib/ambling/data.rb
Parent: Base

Holds an array of values

Methods

<<   build_xml   new   push   values=  

Attributes

attributes  [R] 
values  [R] 

Public Class methods

[Source]

# File lib/ambling/data.rb, line 79
      def initialize(data = [], attributes = {})
        self.values = data
        @attributes = attributes
      end

Public Instance methods

<<(item)

Alias for push

[Source]

# File lib/ambling/data.rb, line 99
      def build_xml(builder)
        @values.each { |value| value.build_xml(builder) }
      end

[Source]

# File lib/ambling/data.rb, line 89
      def push(item)
        if item.is_a?(Value)
          @values << item
        else
          @values << Value.new(item, {:xid => @values.size+1})
        end
      end

[Source]

# File lib/ambling/data.rb, line 84
      def values=(data)
        @values = []
        data.each {|item| self.push(item)}
      end

[Validate]