Module: SmsRu::MessageCollection
- Included in:
- Cost, SendResult
- Defined in:
- lib/sms_ru/data.rb
Overview
Collection helpers shared by results that wrap a ‘messages` array of per-recipient entries (each responding to #ok?): SmsRu::SendResult and SmsRu::Cost. There is intentionally no lookup-by-phone, since one request may target the same number more than once.
Instance Method Summary collapse
-
#failed ⇒ Array
The recipient entries that failed.
-
#ok ⇒ Array
The recipient entries that succeeded.
-
#ok? ⇒ Boolean
True when every recipient succeeded.
Instance Method Details
#failed ⇒ Array
Returns the recipient entries that failed.
16 |
# File 'lib/sms_ru/data.rb', line 16 def failed = .reject(&:ok?) |
#ok ⇒ Array
Returns the recipient entries that succeeded.
13 |
# File 'lib/sms_ru/data.rb', line 13 def ok = .select(&:ok?) |
#ok? ⇒ Boolean
Returns true when every recipient succeeded.
10 |
# File 'lib/sms_ru/data.rb', line 10 def ok? = .all?(&:ok?) |