Skip to content

Commit 2b8e31c

Browse files
Update README.md
1 parent 2711b5b commit 2b8e31c

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

README.md

+26-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# EasyGravatar
22

3-
TODO: Write a gem description
3+
Gravatar.com, mainly known for its avatar hosting. But users can store more than only an avatar at gravatar.
4+
5+
This gem also allows you to easily access it all (accounts at other social networks, more photo's, the name of the user, saved websites, cryptocurrency accounts and more)
46

57
## Installation
68

@@ -20,7 +22,29 @@ Or install it yourself as:
2022

2123
## Usage
2224

23-
TODO: Write usage instructions here
25+
Creating an instance is easy:
26+
```ruby
27+
user = EasyGravatar::Gravatar.new("foo@bar.com")
28+
```
29+
30+
Or use the even shorter class Gravatar:
31+
```ruby
32+
user = Gravatar.new("foo@bar.com")
33+
```
34+
35+
After creating an instance you can get some basics fast using
36+
```ruby
37+
user.full_name # => the full name of the user
38+
user.avatar # => the avatar from the user, in the default gravatar width of 80 pixels
39+
user.avatar(150) # => the avatar from the user, in with a width of 150 pixels
40+
```
41+
Feel free to contribute to the project and add your own "short getters".
42+
43+
All the available information is saved in a hash. Use `user.hash` to get the hash. As an alternative it is also possible to easily read from the hash.
44+
```ruby
45+
user.get_value(:formattedName) # => also gives the full name
46+
user.get_value(:currency, :bitcoin) # => gives the users bitcoin address
47+
```
2448

2549
## Contributing
2650

0 commit comments

Comments
 (0)