Sha256: 5b5bd3a11a79a2334ec4ec0e532601059d95368d759e1bf3194bf1a47c77cf93

Contents?: true

Size: 644 Bytes

Versions: 1

Compression:

Stored size: 644 Bytes

Contents

require "rubygems" if RUBY_VERSION < "1.9.0"
require "net/http"
require "uri"
require "oauth"
require "json"

class Pupil
  attr_reader :screen_name
  class NetworkError < StandardError ; end
  
  TWITTER_API_URL = "https://api.twitter.com"

  # @param [Hash] pupil_key
  def initialize key
    @consumer = OAuth::Consumer.new(
      key[:consumer_key],
      key[:consumer_secret],
      :site => TWITTER_API_URL
    )
    @access_token = OAuth::AccessToken.new(
      @consumer,
      key[:access_token],
      key[:access_token_secret]
    )

    @screen_name = key[:screen_name] || self.profile.screen_name
  end
  
  include Essentials
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pupil-0.6.3 lib/pupil/base.rb