Class: Twilio::REST::Messaging::V2::TypingIndicatorPageMetadata

Inherits:
PageMetadata
  • Object
show all
Defined in:
lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb

Constant Summary

Constants inherited from PageMetadata

PageMetadata::META_KEYS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from PageMetadata

#get_key, #next_page, #next_page_url, #previous_page, #previous_page_url, #process_response

Constructor Details

#initialize(version, response, solution, limit) ⇒ TypingIndicatorPageMetadata

Returns a new instance of TypingIndicatorPageMetadata.



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
# File 'lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb', line 138

def initialize(version, response, solution, limit)
    super(version, response)
    @typing_indicator_page = []
    @limit = limit
    key = get_key(response.body)
    records = 0
    while( limit != :unset && records < limit )
        @typing_indicator_page << TypingIndicatorListResponse.new(version, @payload, key, limit - records)
        @payload = self.next_page
        break unless @payload
        records += @payload.body[key].size
    end
    # Path Solution
    @solution = solution
end

Instance Attribute Details

#typing_indicator_pageObject (readonly)

Returns the value of attribute typing_indicator_page.



136
137
138
# File 'lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb', line 136

def typing_indicator_page
  @typing_indicator_page
end

Instance Method Details

#eachObject



154
155
156
157
158
# File 'lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb', line 154

def each
    @typing_indicator_page.each do |record|
      yield record
    end
end

#to_sObject



160
161
162
# File 'lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb', line 160

def to_s
  '<Twilio::REST::Messaging::V2PageMetadata>';
end