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



163
164
165
# File 'lib/mobiscroll/connect/models.rb', line 163

def events
  @events
end

#next_page_tokenObject

Returns the value of attribute next_page_token

Returns:

  • (Object)

    the current value of next_page_token



163
164
165
# File 'lib/mobiscroll/connect/models.rb', line 163

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



163
164
165
# File 'lib/mobiscroll/connect/models.rb', line 163

def page_size
  @page_size
end

Class Method Details

.from_h(hash) ⇒ Object



164
165
166
167
168
169
170
171
172
173
# File 'lib/mobiscroll/connect/models.rb', line 164

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