Class: Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHours

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

Information about business hour of the place.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleMapsPlacesV1PlaceOpeningHours

Returns a new instance of GoogleMapsPlacesV1PlaceOpeningHours.



1798
1799
1800
# File 'lib/google/apis/places_v1/classes.rb', line 1798

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

Instance Attribute Details

#open_nowBoolean Also known as: open_now?

Whether the opening hours period is currently active. For regular opening hours and current opening hours, this field means whether the place is open. For secondary opening hours and current secondary opening hours, this field means whether the secondary hours of this place is active. Corresponds to the JSON property openNow

Returns:

  • (Boolean)


1767
1768
1769
# File 'lib/google/apis/places_v1/classes.rb', line 1767

def open_now
  @open_now
end

#periodsArray<Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursPeriod>

The periods that this place is open during the week. The periods are in chronological order, starting with Sunday in the place-local timezone. An empty (but not absent) value indicates a place that is never open, e.g. because it is closed temporarily for renovations. Corresponds to the JSON property periods



1776
1777
1778
# File 'lib/google/apis/places_v1/classes.rb', line 1776

def periods
  @periods
end

#secondary_hours_typeString

A type string used to identify the type of secondary hours. Corresponds to the JSON property secondaryHoursType

Returns:

  • (String)


1781
1782
1783
# File 'lib/google/apis/places_v1/classes.rb', line 1781

def secondary_hours_type
  @secondary_hours_type
end

#special_daysArray<Google::Apis::PlacesV1::GoogleMapsPlacesV1PlaceOpeningHoursSpecialDay>

Structured information for special days that fall within the period that the returned opening hours cover. Special days are days that could impact the business hours of a place, e.g. Christmas day. Set for current_opening_hours and current_secondary_opening_hours if there are exceptional hours. Corresponds to the JSON property specialDays



1789
1790
1791
# File 'lib/google/apis/places_v1/classes.rb', line 1789

def special_days
  @special_days
end

#weekday_descriptionsArray<String>

Localized strings describing the opening hours of this place, one string for each day of the week. Will be empty if the hours are unknown or could not be converted to localized text. Example: "Sun: 18:00–06:00" Corresponds to the JSON property weekdayDescriptions

Returns:

  • (Array<String>)


1796
1797
1798
# File 'lib/google/apis/places_v1/classes.rb', line 1796

def weekday_descriptions
  @weekday_descriptions
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1803
1804
1805
1806
1807
1808
1809
# File 'lib/google/apis/places_v1/classes.rb', line 1803

def update!(**args)
  @open_now = args[:open_now] if args.key?(:open_now)
  @periods = args[:periods] if args.key?(:periods)
  @secondary_hours_type = args[:secondary_hours_type] if args.key?(:secondary_hours_type)
  @special_days = args[:special_days] if args.key?(:special_days)
  @weekday_descriptions = args[:weekday_descriptions] if args.key?(:weekday_descriptions)
end