Class: Twilio::REST::Numbers::V1::WebhookListResponse

Inherits:
InstanceListResource show all
Defined in:
lib/twilio-ruby/rest/numbers/v1/webhook.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, key, limit = :unset) ⇒ WebhookListResponse

Returns a new instance of WebhookListResponse.

Parameters:

  • instance (Array<WebhookInstance>)
  • headers (Hash{String => Object})
  • status_code (Integer)


149
150
151
152
153
154
155
156
157
158
159
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 149

def initialize(version, payload, key, limit = :unset)
  data_list = payload.body[key]
  if limit != :unset
    data_list = data_list[0, limit]
  end
  @webhook = data_list.map do |data|
    WebhookInstance.new(version, data)
  end
  @headers = payload.headers
  @status_code = payload.status_code
end

Instance Method Details

#headersObject



165
166
167
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 165

def headers
  @headers
end

#status_codeObject



169
170
171
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 169

def status_code
  @status_code
end

#webhookObject



161
162
163
# File 'lib/twilio-ruby/rest/numbers/v1/webhook.rb', line 161

def webhook
    @webhook
end