Class: MessageBird::List

Inherits:
Base
  • Object
show all
Defined in:
lib/messagebird/list.rb

Direct Known Subclasses

CallFlowList, Voice::List

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#map_hash_elements_to_self, #value_to_time

Constructor Details

#initialize(type, json) ⇒ List

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



12
13
14
15
16
# File 'lib/messagebird/list.rb', line 12

def initialize(type, json)
  @type = type

  super(json)
end

Instance Attribute Details

#countObject

Returns the value of attribute count.



7
8
9
# File 'lib/messagebird/list.rb', line 7

def count
  @count
end

#itemsObject

Returns the value of attribute items.



8
9
10
# File 'lib/messagebird/list.rb', line 8

def items
  @items
end

#limitObject

Returns the value of attribute limit.



7
8
9
# File 'lib/messagebird/list.rb', line 7

def limit
  @limit
end

Returns the value of attribute links.



7
8
9
# File 'lib/messagebird/list.rb', line 7

def links
  @links
end

#offsetObject

Returns the value of attribute offset.



7
8
9
# File 'lib/messagebird/list.rb', line 7

def offset
  @offset
end

#total_countObject

Returns the value of attribute total_count.



7
8
9
# File 'lib/messagebird/list.rb', line 7

def total_count
  @total_count
end

Instance Method Details

#[](index) ⇒ Object



22
23
24
# File 'lib/messagebird/list.rb', line 22

def [](index)
  @items[index]
end