lib/straightedge/extend/array.rb in straightedge-0.1.0 vs lib/straightedge/extend/array.rb in straightedge-0.1.1
- old
+ new
@@ -1,23 +1,12 @@
class Array
- extend Forwardable
+ include Straightedge::Aspects::Positional
+ include Straightedge::Aspects::Figural
def sum
inject(&:+)
end
def mean
sum / size
end
-
- # consider the array as a vector in n-space (where n is the self.length)
- def to_point
- Straightedge::Mark.new(*self)
- end
- def_delegators :to_point, :x, :y
-
- # consider the array as an array of points
- def to_points
- Straightedge::Figure.new(self)
- end
- def_delegators :to_points, :adjacent, :center
end