Sha256: abd249a352d89096eecb8ff20011f5f4941a974039e47cbf427fdcc2e240cc02

Contents?: true

Size: 365 Bytes

Versions: 2

Compression:

Stored size: 365 Bytes

Contents

require 'pushbullet_ruby/entity'

module PushbulletRuby
  class Contact < Entity
    def self.from_response(response)
      response.body['contacts'].map do |attributes|
        next unless attributes['active']
        new(attributes)
      end
    end

    def name
      body['name']
    end

    def email
      body['email']
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pushbullet_ruby-1.0.3 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.0.2.1 lib/pushbullet_ruby/contact.rb