Class: SportsDataApi::Nfl::Quarters
- Inherits:
-
Object
- Object
- SportsDataApi::Nfl::Quarters
- Includes:
- Enumerable
- Defined in:
- lib/sports_data_api/nfl/quarters.rb
Instance Attribute Summary collapse
-
#quarters ⇒ Object
readonly
Returns the value of attribute quarters.
Instance Method Summary collapse
- #each(&block) ⇒ Object
-
#initialize(quarters_hash) ⇒ Quarters
constructor
A new instance of Quarters.
Constructor Details
#initialize(quarters_hash) ⇒ Quarters
Returns a new instance of Quarters.
7 8 9 10 11 |
# File 'lib/sports_data_api/nfl/quarters.rb', line 7 def initialize(quarters_hash) @quarters = quarters_hash.map do |quarter| Quarter.new(quarter) end end |
Instance Attribute Details
#quarters ⇒ Object (readonly)
Returns the value of attribute quarters.
5 6 7 |
# File 'lib/sports_data_api/nfl/quarters.rb', line 5 def quarters @quarters end |
Instance Method Details
#each(&block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/sports_data_api/nfl/quarters.rb', line 13 def each &block quarters.each do |quarter| if block_given? block.call quarter else yield quarter end end end |