Class: Collection
- Inherits:
-
Array
- Object
- Array
- Collection
- Defined in:
- lib/prooflink_connect/portable_contacts/collection.rb
Instance Attribute Summary collapse
-
#per_page ⇒ Object
readonly
Returns the value of attribute per_page.
-
#start_index ⇒ Object
readonly
Returns the value of attribute start_index.
-
#total_entries ⇒ Object
readonly
Returns the value of attribute total_entries.
Instance Method Summary collapse
-
#initialize(data) ⇒ Collection
constructor
A new instance of Collection.
Constructor Details
#initialize(data) ⇒ Collection
Returns a new instance of Collection.
4 5 6 7 8 9 |
# File 'lib/prooflink_connect/portable_contacts/collection.rb', line 4 def initialize(data) super data["entry"].collect{|e| PortableContacts::Person.new(e) } @total_entries=data["totalResults"].to_i @per_page=data["itemsPerPage"].to_i @start_index=data["startIndex"].to_i end |
Instance Attribute Details
#per_page ⇒ Object (readonly)
Returns the value of attribute per_page.
2 3 4 |
# File 'lib/prooflink_connect/portable_contacts/collection.rb', line 2 def per_page @per_page end |
#start_index ⇒ Object (readonly)
Returns the value of attribute start_index.
2 3 4 |
# File 'lib/prooflink_connect/portable_contacts/collection.rb', line 2 def start_index @start_index end |
#total_entries ⇒ Object (readonly)
Returns the value of attribute total_entries.
2 3 4 |
# File 'lib/prooflink_connect/portable_contacts/collection.rb', line 2 def total_entries @total_entries end |