Sha256: b06f54eb097e539a7f312065935939d060cb3183411880d24bf969a9db6c8a89
Contents?: true
Size: 1.1 KB
Versions: 1
Compression:
Stored size: 1.1 KB
Contents
# frozen_string_literal: true module Boppers module Notifier class Twitter attr_reader :consumer_key, :consumer_secret, :access_token, :access_secret, :user, :subscribe def initialize( consumer_key:, consumer_secret:, access_token:, access_secret:, user:, subscribe: nil ) require "twitter" @consumer_key = consumer_key @consumer_secret = consumer_secret @access_token = access_token @access_secret = access_secret @user = user @subscribe = subscribe end def call(title, message, _options) client = ::Twitter::REST::Client.new do |config| config.consumer_key = consumer_key config.consumer_secret = consumer_secret config.access_token = access_token config.access_token_secret = access_secret end body = "#{title}\n\n#{message}" client.create_direct_message(user, body) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
boppers-0.0.11 | lib/boppers/notifier/twitter.rb |