Module: VoiceML::Pageable

Overview

Twilio-compatible pagination envelope fields. Mix into list-response classes to expose page, page_size, total, next_page_uri, previous_page_uri, first_page_uri, uri, num_pages, start, end. The list items themselves are declared on each concrete subclass (calls, conferences, etc).

Constant Summary collapse

PAGE_FIELDS =
%w[
  page page_size num_pages total start end
  first_page_uri next_page_uri previous_page_uri uri
].freeze

Instance Method Summary collapse

Instance Method Details

#assign_page_fields(hash) ⇒ Object



18
19
20
21
22
# File 'lib/voiceml/models/common.rb', line 18

def assign_page_fields(hash)
  PAGE_FIELDS.each do |field|
    instance_variable_set("@#{field}", hash[field])
  end
end