SharpSocial

Build Status

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

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request