class MapboxDirections::Location
Attributes
name[R]
point[R]
Public Class Methods
from_geojson(geojson)
click to toggle source
# File lib/mapbox_directions/model/location.rb, line 10 def self.from_geojson(geojson) new(point: Point.from_geojson(geojson), name: geojson["properties"]["name"]) end
new(attrs)
click to toggle source
# File lib/mapbox_directions/model/location.rb, line 14 def initialize(attrs) @point = attrs[:point] || Point.new(attrs[:lat], attrs[:lng]) @name = attrs[:name] end