Class: Mobiscroll::Connect::EventsListResponse

Inherits:
Struct
  • Object
show all
Defined in:
lib/mobiscroll/connect/models.rb

Overview

Paginated response from Events#list.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#eventsObject

Returns the value of attribute events

Returns:

  • (Object)

    the current value of events



191
192
193
# File 'lib/mobiscroll/connect/models.rb', line 191

def events
  @events
end

#next_page_tokenObject

Returns the value of attribute next_page_token

Returns:

  • (Object)

    the current value of next_page_token



191
192
193
# File 'lib/mobiscroll/connect/models.rb', line 191

def next_page_token
  @next_page_token
end

#page_sizeObject

Returns the value of attribute page_size

Returns:

  • (Object)

    the current value of page_size



191
192
193
# File 'lib/mobiscroll/connect/models.rb', line 191

def page_size
  @page_size
end

Class Method Details

.from_h(hash) ⇒ Object



192
193
194
195
196
197
198
199
200
201
# File 'lib/mobiscroll/connect/models.rb', line 192

def self.from_h(hash)
  return new(events: [], page_size: nil, next_page_token: nil) if hash.nil?

  events = (hash['events'] || hash[:events] || []).map { |e| CalendarEvent.from_h(e) }
  new(
    events: events,
    page_size: hash['pageSize'] || hash[:pageSize],
    next_page_token: hash['nextPageToken'] || hash[:nextPageToken]
  )
end