SharpSocial
Installation
Add this line to your application's Gemfile:
gem 'sharp_social'
And then execute:
$ bundle
$ rails g sharp_social install
Or install it yourself as:
$ gem install sharp_social
Usage
setup
Add acts_as_actor
to your model which need to act as an actor
class User < ActiveRecord::Base
...
acts_as_actor
...
end
API
@user.follow(@other_user)
@user.is_following?(@other_user) => true
@other_user.is_followed(@user) => true
@user.followings_count => 1
@other_user.follower_count => 1
@other_user.follow!(@user)
@other_user.is_friend(@other_user) => true
@user.is_friend?(@other_user) => true
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request