Module: Gravaty

Defined in:
lib/gravaty.rb,
lib/gravaty/parser.rb,
lib/gravaty/version.rb,
lib/gravaty/constants.rb,
lib/gravaty/application.rb,
lib/gravaty/parsers/type.rb,
lib/gravaty/parsers/force.rb,
lib/gravaty/utils/raisers.rb,
lib/gravaty/utils/rfc5322.rb,
lib/gravaty/parsers/avatar.rb,
lib/gravaty/parsers/format.rb,
lib/gravaty/parsers/rating.rb,
lib/gravaty/parsers/secure.rb,
lib/gravaty/parsers/default.rb,
lib/gravaty/parsers/callback.rb,
lib/gravaty/utils/downloader.rb,
lib/gravaty/parsers/pixelsize.rb,
lib/gravaty/utils/rpc_connector.rb

Overview

– gravaty Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani

This file is part of gravaty.

gravaty is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

gravaty is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with gravaty. If not, see <www.gnu.org/licenses/>. ++

Defined Under Namespace

Modules: Parsers, Utils Classes: Gravaty, Parser

Constant Summary collapse

VERSION =

Current version number for Gravaty gem.

'9.0.0'
ALLOWED_SIZES =

Allowed sizes (in pixels) for images requests. Currently a range from 1 to 2048 (included).

(1...2048)
ALLOWED_PARAMS =

Allowed parameters names. Currently: avatar, callback, default, force, format, pixelsize, rating, secure and type.

[:avatar, :callback, :default, :force, :format,
:pixelsize, :rating, :secure, :type]
AVATAR_FORMATS =

Allowed formats (extensions) for avatar requests. Currently: jp(e)g, png and gif.

%w(jpg jpeg png gif)
DEFAULT_OPTIONS =

Currently allowed default builtin options. Currently: 404, mp, identicon, monsterid,wavatar, retro, robohash and blank.

%w(404 mp identicon monsterid wavatar retro robohash blank)
IMAGES_FORMATS =

Allowed formats (extensions) for default own images. Currently: jp(e)g, png and gif.

%w(jpg jpeg png gif)
PROFILE_FORMATS =

Allowed formats (extensions) for profile requests. Currently: json, xml, php, vcf and qr.

%w(json xml php vcf qr)
PROFILES =

Formats allowing supplemental options for profile requests. Currently json and qr.

%w(json qr)
RATING_OPTIONS =

Allowed rating options. Currently: g, pg, r and x.

%w(g pg r x)
RPC_ERRORS =

Possible XML-RPC API errors.

[-7, -8, -9, -10, -11, -100]
RPC_METHODS =

Allowed XML-RPC API methods.

%w(grav.exists grav.addresses grav.userimages grav.saveData grav.saveUrl grav.useUserimage grav.removeImage grav.deleteUserimage grav.test)
RPC_TEST_METHOD =

Default test method for XML-RPC API.

'grav.test'
RPC_URI =

Reference URI for XML-RPC API.

'secure.gravatar.com'

Class Method Summary collapse

Class Method Details

.gravatize(email_address) ⇒ Object

Creates a new Gravaty described by the user’s email. Throws a ArgumentError exception if the supplied email address is nil or not valid according to RFC5322.

Usage
  • new_gravaty = Gravaty::gravatize email

  • new_gravaty = Gravaty::gravatize(email)

Params

email_address, the user’s email address (a syntactically

valid one).

Returns

a Gravaty object for the specified email address.

Raises

ArgumentError, if the supplied email address is nil

or not valid according to RFC 5322.



53
54
55
# File 'lib/gravaty.rb', line 53

def self.gravatize(email_address)
  Gravaty.new email_address, parser
end