diff --git a/lib/messagebird/list.rb b/lib/messagebird/list.rb index aed7ccd..6099678 100644 --- a/lib/messagebird/list.rb +++ b/lib/messagebird/list.rb @@ -2,23 +2,25 @@ require 'messagebird/base' -class List < MessageBird::Base - attr_accessor :offset, :limit, :count, :total_count, :links - attr_reader :items +module MessageBird + class List < MessageBird::Base + attr_accessor :offset, :limit, :count, :total_count, :links + attr_reader :items - # type will be used to create objects for the items, e.g. - # List.new(Contact, {}). - def initialize(type, json) - @type = type + # type will be used to create objects for the items, e.g. + # List.new(Contact, {}). + def initialize(type, json) + @type = type - super(json) - end + super(json) + end - def items=(value) - @items = value.map { |i| @type.new i } - end + def items=(value) + @items = value.map { |i| @type.new i } + end - def [](index) - @items[index] + def [](index) + @items[index] + end end -end +end \ No newline at end of file