class List

Attributes

count[RW]
items[R]
limit[RW]
offset[RW]
total_count[RW]

Public Class Methods

new(type, json) click to toggle source

type will be used to create objects for the items, e.g. List.new(Contact, {}).

Calls superclass method MessageBird::Base::new
# File lib/messagebird/list.rb, line 11
def initialize(type, json)
  @type = type

  super(json)
end

Public Instance Methods

[](index) click to toggle source
# File lib/messagebird/list.rb, line 21
def [](index)
  @items[index]
end
items=(value) click to toggle source
# File lib/messagebird/list.rb, line 17
def items=(value)
  @items = value.map { |i| @type.new i }
end