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.



2541
2542
2543
# File 'lib/google/apis/places_v1/classes.rb', line 2541

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)


2534
2535
2536
# File 'lib/google/apis/places_v1/classes.rb', line 2534

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)


2539
2540
2541
# File 'lib/google/apis/places_v1/classes.rb', line 2539

def duration
  @duration
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2546
2547
2548
2549
# File 'lib/google/apis/places_v1/classes.rb', line 2546

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