travis-ci
42 of 42 new or added lines in 13 files covered. (100.0%)
26797 of 73477 relevant lines covered (36.47%)
19617.54 hits per line
1 |
module Charta |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
2 |
# Represent a Point
|
× |
3 |
class Point < Geometry |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
4 |
def x |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
5 |
coordinates(:x)
|
× |
6 |
end
|
× |
7 |
alias longitude x |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
8 |
|
× |
9 |
def y |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
10 |
coordinates(:y)
|
× |
11 |
end
|
× |
12 |
alias latitude y |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
13 |
|
× |
14 |
protected |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
15 |
|
× |
16 |
# Computes X,Y in one time and store it
|
× |
17 |
def coordinates(axis) |
3 all except 2.2.3, TEST_SUITE=frontend ✔ |
18 |
unless @coordinates |
× |
19 |
coord = select_row("SELECT ST_X(#{geom}), ST_Y(#{geom})")
|
× |
20 |
@coordinates = { x: coord[0].to_d, y: coord[1].to_d } |
× |
21 |
end
|
× |
22 |
@coordinates[axis]
|
× |
23 |
end
|
× |
24 |
end
|
× |
25 |
end
|
× |