Class: MailCapture::CaptureList
- Inherits:
-
Object
- Object
- MailCapture::CaptureList
- Defined in:
- lib/mailcapture/models.rb
Overview
Response from list.
Instance Attribute Summary collapse
- #count ⇒ Integer readonly
- #items ⇒ Array<Capture> readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ CaptureList
constructor
A new instance of CaptureList.
Constructor Details
#initialize(data) ⇒ CaptureList
Returns a new instance of CaptureList.
69 70 71 72 |
# File 'lib/mailcapture/models.rb', line 69 def initialize(data) @items = (data['items'] || []).map { |item| Capture.from_hash(item) } @count = data['count'].to_i end |
Instance Attribute Details
#count ⇒ Integer (readonly)
63 64 65 |
# File 'lib/mailcapture/models.rb', line 63 def count @count end |
#items ⇒ Array<Capture> (readonly)
61 62 63 |
# File 'lib/mailcapture/models.rb', line 61 def items @items end |
Class Method Details
.from_hash(data) ⇒ Object
65 66 67 |
# File 'lib/mailcapture/models.rb', line 65 def self.from_hash(data) new(data) end |