Class Ambling::Data::XyGraph
In: lib/ambling/data.rb
Parent: Object

xy graphs contain points, not values I know I should abstract the BaseValueHolder to handle a generic array of Values. Unfortunately, I don‘t have time right now

Methods

<<   build_xml   new   points=   push  

Attributes

points  [R] 

Public Class methods

[Source]

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

Public Instance methods

<<(item)

Alias for push

[Source]

# File lib/ambling/data.rb, line 148
      def build_xml(builder)
        @points.each { |point| point.build_xml(builder) }
      end

[Source]

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

[Source]

# File lib/ambling/data.rb, line 138
      def push(item)
        if item.is_a?(Point)
          @points << item
        else
          @points << Point.new(item)
        end
      end

[Validate]