-
-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathlist.rb
More file actions
25 lines (20 loc) · 506 Bytes
/
list.rb
File metadata and controls
25 lines (20 loc) · 506 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# frozen_string_literal: true
module OpenWeather
module Models
class List < Model
include Enumerable
property 'cod'
property 'calctime'
property 'cnt', from: 'count'
property 'list'
property 'message'
def initialize(args = nil, options = {})
super args, options
self.list = list.map { |i| OpenWeather::Models::City::Weather.new(i, options) } if list
end
def each(&block)
list.each(&block)
end
end
end
end