Sha256: bf4dd83775317f3440329597132fa0547487b658e25592376db55f9659b8e8ae

Contents?: true

Size: 392 Bytes

Versions: 13

Compression:

Stored size: 392 Bytes

Contents

require 'pushbullet_ruby/user'

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

    def name
      body['name']
    end

    def email
      body['email']
    end
  end
end

Version data entries

13 entries across 12 versions & 2 rubygems

Version Path
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/contact.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/tdiary-5.1.5/vendor/bundle/ruby/3.0.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/contact.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/contact.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/contact.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.1.4 lib/pushbullet_ruby/contact.rb
tdiary-5.0.8 vendor/bundle/gems/pushbullet_ruby-1.1.3/lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.1.3 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.1.2 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.1.1 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.1.0 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.0.4.1 lib/pushbullet_ruby/contact.rb
pushbullet_ruby-1.0.4 lib/pushbullet_ruby/contact.rb