Class: BreweryDB::Collection
- Inherits:
-
Object
- Object
- BreweryDB::Collection
- Includes:
- Enumerable
- Defined in:
- lib/brewery_db/collection.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#size ⇒ Object
(also: #length)
readonly
Returns the value of attribute size.
Instance Method Summary collapse
- #each ⇒ Object
-
#initialize(response) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(response) ⇒ Collection
Returns a new instance of Collection.
8 9 10 |
# File 'lib/brewery_db/collection.rb', line 8 def initialize(response) self.response = response end |
Instance Attribute Details
#size ⇒ Object (readonly) Also known as: length
Returns the value of attribute size.
5 6 7 |
# File 'lib/brewery_db/collection.rb', line 5 def size @size end |
Instance Method Details
#each ⇒ Object
12 13 14 15 |
# File 'lib/brewery_db/collection.rb', line 12 def each return to_enum unless block_given? @collection.each { |element| yield(element) } end |