Class: Array
- Inherits:
-
Object
- Object
- Array
- Includes:
- GeoVector::Macros
- Defined in:
- lib/geo_vectors/core_ext.rb,
lib/geo_vectors/macros.rb
Overview
Should use sugar-high array ext in the future!
Direct Known Subclasses
Instance Method Summary collapse
Methods included from GeoVector::Macros
Instance Method Details
#extract(sym) ⇒ Object
13 14 15 |
# File 'lib/geo_vectors/core_ext.rb', line 13 def extract(sym) map { |e| e.send(sym) } end |
#mean ⇒ Object
21 22 23 |
# File 'lib/geo_vectors/core_ext.rb', line 21 def mean (size > 0) ? sum.to_f / size : 0 end |
#sum ⇒ Object
17 18 19 |
# File 'lib/geo_vectors/core_ext.rb', line 17 def sum inject( 0 ) { |sum,x| sum + x } end |
#to_point ⇒ Object
30 31 32 |
# File 'lib/geo_vectors/macros.rb', line 30 def to_point geo_point end |