Class Ambling::Data::Pie
In: lib/ambling/data.rb
Parent: BaseData

For an amchart pie chart

Methods

<<   build_xml   new   push   slices=  

Attributes

slices  [R] 

Public Class methods

[Source]

# File lib/ambling/data.rb, line 230
      def initialize(data = [])
        self.slices = data
      end

Public Instance methods

<<(item)

Alias for push

[Source]

# File lib/ambling/data.rb, line 249
      def build_xml(builder)
        @message.build_xml(builder) if !@message.nil?
        @slices.each {|s| s.build_xml(builder)}
      end

[Source]

# File lib/ambling/data.rb, line 239
      def push(item)
        if item.is_a?(Slice)
          @slices << item
        else
          @slices << Slice.new(item)
        end
      end

[Source]

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

[Validate]