Sha256: 3775d9c2b4da74373d410826460217186fa16d2e849743edbbba271d403139d1

Contents?: true

Size: 462 Bytes

Versions: 13

Compression:

Stored size: 462 Bytes

Contents

module RPXNow
  # Makes returned contacts feel like a array
  class ContactsCollection < Array
    def initialize(list)
      @raw = list
      @additional_info = list.reject{|k,v|k=='entry'}
      list['entry'].each{|item| self << parse_data(item)}
    end

    def additional_info;@additional_info;end
    def raw;@raw;end

    private

    def parse_data(entry)
      entry['emails'] = entry['emails'].map{|email| email['value']}
      entry
    end
  end
end

Version data entries

13 entries across 13 versions & 3 rubygems

Version Path
rpx_now-0.6.13 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.12 lib/rpx_now/contacts_collection.rb
kent-rpx_now-0.6.11 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.11 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.10 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.9 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.8 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.7 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.6 lib/rpx_now/contacts_collection.rb
spyou_rpx_now-0.6.6 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.5 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.4 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.1 lib/rpx_now/contacts_collection.rb