Sha256: 836d311bb389243ea16445ab5ef8bff5957ba57e87b25039fc140bef65eaa966

Contents?: true

Size: 1007 Bytes

Versions: 2

Compression:

Stored size: 1007 Bytes

Contents

module Whatser
  class Follow < Whatser::Resource
    attr_accessor :id
    attr_accessor :name,:avatar_pic,:location
    attr_accessor :promoted,:collections_count
    attr_accessor :following,:followed,:foaf_count,:foaf
    
    class << self
      def list(opts={})
        api_request :get, "/api/follows", {:query => opts}
      end
      
      def suggested(opts={})
        api_request :get, "/api/users/suggested", {:query => opts}
      end        
      
      def create(user_id, opts={})
        api_request :post, "/api/follows/#{user_id}", {:query => opts, :body => ''}
      end

      def delete(user_id)
        api_request :delete, "/api/follows/#{user_id}"
      end
      
      def ignore(user_id)
        delete(user_id)
      end
      
      def connection(user_id)
        api_request :get, "/api/users/#{user_id}/connection"
      end        
    end
    
    def save
      self.class.create( id )
    end      
    
    def delete
      self.class.ignore( id )
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
whatser-0.6.0 lib/whatser/resources/follow.rb
whatser-0.5.0 lib/whatser/resources/follow.rb