Class: Google::Apis::PlacesV1::GoogleMapsPlacesV1RoutingSummaryLeg

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/places_v1/classes.rb,
lib/google/apis/places_v1/representations.rb,
lib/google/apis/places_v1/representations.rb

Overview

A leg is a single portion of a journey from one location to another.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsPlacesV1RoutingSummaryLeg

Returns a new instance of GoogleMapsPlacesV1RoutingSummaryLeg.



2788
2789
2790
# File 'lib/google/apis/places_v1/classes.rb', line 2788

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#distance_metersFixnum

The distance of this leg of the trip. Corresponds to the JSON property distanceMeters

Returns:

  • (Fixnum)


2781
2782
2783
# File 'lib/google/apis/places_v1/classes.rb', line 2781

def distance_meters
  @distance_meters
end

#durationString

The time it takes to complete this leg of the trip. Corresponds to the JSON property duration

Returns:

  • (String)


2786
2787
2788
# File 'lib/google/apis/places_v1/classes.rb', line 2786

def duration
  @duration
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2793
2794
2795
2796
# File 'lib/google/apis/places_v1/classes.rb', line 2793

def update!(**args)
  @distance_meters = args[:distance_meters] if args.key?(:distance_meters)
  @duration = args[:duration] if args.key?(:duration)
end