Sha256: f6e8419d6fd6ed0e7283afb8db709d7b87433432462704dd288674462722cb25

Contents?: true

Size: 539 Bytes

Versions: 10

Compression:

Stored size: 539 Bytes

Contents

require 'pushbullet_ruby/entity'
require 'pushbullet_ruby/api/pushes'

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

    def update(client: nil, params: {})
      client.update_push(push_id: self.id, params: params)
    end

    def id
      body['iden']
    end

    def type
      body['type']
    end
  end
end

Version data entries

10 entries across 9 versions & 2 rubygems

Version Path
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/push.rb
tdiary-5.1.6 vendor/bundle/ruby/2.7.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/push.rb
tdiary-5.1.5 vendor/bundle/ruby/3.0.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/push.rb
tdiary-5.1.2 vendor/bundle/ruby/2.6.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/push.rb
tdiary-5.1.1 vendor/bundle/ruby/2.6.0/gems/pushbullet_ruby-1.1.4/lib/pushbullet_ruby/push.rb
pushbullet_ruby-1.1.4 lib/pushbullet_ruby/push.rb
tdiary-5.0.8 vendor/bundle/gems/pushbullet_ruby-1.1.3/lib/pushbullet_ruby/push.rb
pushbullet_ruby-1.1.3 lib/pushbullet_ruby/push.rb
pushbullet_ruby-1.1.2 lib/pushbullet_ruby/push.rb
pushbullet_ruby-1.1.1 lib/pushbullet_ruby/push.rb