Sha256: dd883713c9044f568f74d86a456f77684fb436ba7048c861fa2c70ddf717a9e1

Contents?: true

Size: 487 Bytes

Versions: 16

Compression:

Stored size: 487 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'] ? entry['emails'].map{|email| email['value']} : [])
      entry
    end
  end
end

Version data entries

16 entries across 16 versions & 3 rubygems

Version Path
rpx_now-0.7.1 lib/rpx_now/contacts_collection.rb
rpx_now-0.7.0 lib/rpx_now/contacts_collection.rb
slayer-rpx_now-0.6.25 lib/rpx_now/contacts_collection.rb
slayer-rpx_now-0.6.24 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.24 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.23 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.22 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.21 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.20 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.19 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.18 lib/rpx_now/contacts_collection.rb
Empact-rpx_now-0.7.0 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.17 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.16 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.15 lib/rpx_now/contacts_collection.rb
rpx_now-0.6.14 lib/rpx_now/contacts_collection.rb