Skip to content

Commit

Permalink
feat(query): Construtor with floats for InsidePolygon & InsideBoundin…
Browse files Browse the repository at this point in the history
…gBox (#367)
  • Loading branch information
ElPicador authored Mar 10, 2017
1 parent df6d502 commit 0853efc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/main/scala/algolia/objects/InsideBoundingBox.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,17 @@ case class InsideBoundingBox(p1Lat: String,
override def toString = s"$p1Lat,$p1Lng,$p2Lat,$p2Lng"

}

object InsideBoundingBox {

def apply(p1Lat: Float,
p1Lng: Float,
p2Lat: Float,
p2Lng: Float): InsideBoundingBox = {
InsideBoundingBox(p1Lat.toString,
p1Lng.toString,
p2Lat.toString,
p2Lng.toString)
}

}
20 changes: 20 additions & 0 deletions src/main/scala/algolia/objects/InsidePolygon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ case class InsidePolygon(p1Lat: String,
override def toString = s"$p1Lat,$p1Lng,$p2Lat,$p2Lng,$p3Lat,$p3Lng"

}

object InsidePolygon {

def apply(p1Lat: Float,
p1Lng: Float,
p2Lat: Float,
p2Lng: Float,
p3Lat: Float,
p3Lng: Float): InsidePolygon = {
InsidePolygon(
p1Lat.toString,
p1Lng.toString,
p2Lat.toString,
p2Lng.toString,
p3Lat.toString,
p3Lng.toString
)
}

}

0 comments on commit 0853efc

Please sign in to comment.