Module: Redd

Defined in:
lib/redd/version.rb,
lib/redd.rb,
lib/redd/base.rb,
lib/redd/error.rb,
lib/redd/thing.rb,
lib/redd/rate_limit.rb,
lib/redd/object/user.rb,
lib/redd/client/oauth2.rb,
lib/redd/oauth2_access.rb,
lib/redd/object/comment.rb,
lib/redd/object/listing.rb,
lib/redd/thing/editable.rb,
lib/redd/thing/hideable.rb,
lib/redd/thing/saveable.rb,
lib/redd/thing/voteable.rb,
lib/redd/thing/inboxable.rb,
lib/redd/object/subreddit.rb,
lib/redd/object/wiki_page.rb,
lib/redd/thing/reportable.rb,
lib/redd/object/submission.rb,
lib/redd/thing/messageable.rb,
lib/redd/thing/moderatable.rb,
lib/redd/response/parse_json.rb,
lib/redd/client/authenticated.rb,
lib/redd/object/more_comments.rb,
lib/redd/response/raise_error.rb,
lib/redd/client/oauth2/identity.rb,
lib/redd/client/unauthenticated.rb,
lib/redd/object/private_message.rb,
lib/redd/client/authenticated/apps.rb,
lib/redd/client/authenticated/gold.rb,
lib/redd/client/authenticated/live.rb,
lib/redd/client/authenticated/wiki.rb,
lib/redd/client/authenticated/flair.rb,
lib/redd/client/authenticated/users.rb,
lib/redd/client/authenticated/multis.rb,
lib/redd/client/oauth2/authorization.rb,
lib/redd/client/unauthenticated/live.rb,
lib/redd/client/unauthenticated/wiki.rb,
lib/redd/client/authenticated/account.rb,
lib/redd/client/unauthenticated/account.rb,
lib/redd/client/unauthenticated/captcha.rb,
lib/redd/client/unauthenticated/listing.rb,
lib/redd/client/authenticated/moderation.rb,
lib/redd/client/authenticated/subreddits.rb,
lib/redd/client/unauthenticated/utilities.rb,
lib/redd/client/unauthenticated/moderation.rb,
lib/redd/client/unauthenticated/subreddits.rb,
lib/redd/client/authenticated/links_comments.rb,
lib/redd/client/authenticated/private_messages.rb,
lib/redd/client/unauthenticated/links_comments.rb

Overview

The main Redd module.

Defined Under Namespace

Modules: Client, Object, Response Classes: Base, Error, OAuth2Access, RateLimit, Thing

Constant Summary collapse

VERSION =

The semantic version number for Redd.

"0.4.2"

Class Method Summary collapse

Class Method Details

.client(username = nil, password = nil, redirect_uri = nil, options = {}) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/redd.rb', line 6

def self.client(username = nil, password = nil, redirect_uri = nil, options = {})
  if redirect_uri
    Redd::Client::OAuth2.new(username, password, redirect_uri, options)
  elsif username && password
    Redd::Client::Authenticated.new_from_credentials(username, password, options)
  else
    Redd::Client::Unauthenticated.new
  end
end