Class: Notifications::Client::ReceivedTextCollection
- Inherits:
-
Object
- Object
- Notifications::Client::ReceivedTextCollection
- Defined in:
- lib/notifications/client/received_text_collection.rb
Instance Attribute Summary collapse
-
#collection ⇒ Object
readonly
Returns the value of attribute collection.
-
#links ⇒ Object
readonly
Returns the value of attribute links.
Instance Method Summary collapse
- #collection_from(received_texts) ⇒ Object
-
#initialize(response) ⇒ ReceivedTextCollection
constructor
A new instance of ReceivedTextCollection.
Constructor Details
#initialize(response) ⇒ ReceivedTextCollection
Returns a new instance of ReceivedTextCollection.
6 7 8 9 |
# File 'lib/notifications/client/received_text_collection.rb', line 6 def initialize(response) @links = response["links"] @collection = collection_from(response["received_text_messages"]) end |
Instance Attribute Details
#collection ⇒ Object (readonly)
Returns the value of attribute collection.
4 5 6 |
# File 'lib/notifications/client/received_text_collection.rb', line 4 def collection @collection end |
#links ⇒ Object (readonly)
Returns the value of attribute links.
4 5 6 |
# File 'lib/notifications/client/received_text_collection.rb', line 4 def links @links end |
Instance Method Details
#collection_from(received_texts) ⇒ Object
11 12 13 14 15 |
# File 'lib/notifications/client/received_text_collection.rb', line 11 def collection_from(received_texts) received_texts.map do |received_text| ReceivedText.new(received_text) end end |