Skip to content

Commit 9a72f49

Browse files
committed
Wrapped List class inside MessageBird namespace
1 parent a24a32d commit 9a72f49

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

lib/messagebird/list.rb

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
require 'messagebird/base'
22

3-
class List < MessageBird::Base
3+
module MessageBird
4+
class List < MessageBird::Base
5+
attr_accessor :offset, :limit, :count, :totalCount, :links, :items
46

5-
attr_accessor :offset, :limit, :count, :totalCount, :links, :items
7+
# type will be used to create objects for the items, e.g.
8+
# List.new(Contact, {}).
9+
def initialize(type, json)
10+
@type = type
611

7-
# type will be used to create objects for the items, e.g.
8-
# List.new(Contact, {}).
9-
def initialize(type, json)
10-
@type = type
12+
super(json)
13+
end
1114

12-
super(json)
13-
end
14-
15-
def items=(value)
16-
@items = value.map { |i| @type.new i }
17-
end
15+
def items=(value)
16+
@items = value.map { |i| @type.new i }
17+
end
1818

19-
def [](index)
20-
@items[index]
19+
def [](index)
20+
@items[index]
21+
end
2122
end
22-
23-
end
23+
end

0 commit comments

Comments
 (0)