Class: VoiceML::MessageList
- Inherits:
-
Object
- Object
- VoiceML::MessageList
- Includes:
- Pageable
- Defined in:
- lib/voiceml/models/messages.rb
Overview
Paginated ‘GET /Messages` response.
Constant Summary
Constants included from Pageable
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash = {}) ⇒ MessageList
constructor
A new instance of MessageList.
Methods included from Pageable
Constructor Details
#initialize(hash = {}) ⇒ MessageList
Returns a new instance of MessageList.
47 48 49 50 |
# File 'lib/voiceml/models/messages.rb', line 47 def initialize(hash = {}) assign_page_fields(hash) @messages = (hash['messages'] || []).map { |m| Message.from_hash(m) } end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
45 46 47 |
# File 'lib/voiceml/models/messages.rb', line 45 def @messages end |
Class Method Details
.from_hash(hash) ⇒ Object
52 53 54 |
# File 'lib/voiceml/models/messages.rb', line 52 def self.from_hash(hash) new(hash || {}) end |