Sha256: 91485b0f643a3ed49f0a1c2e3cdcdce3b12dcfe254923eb97c258026ed4aa1cd

Contents?: true

Size: 1016 Bytes

Versions: 5

Compression:

Stored size: 1016 Bytes

Contents

module Whatser
  class Follow < Whatser::Resource
    attr_accessor :id
    attr_accessor :name,:avatar_pic,:location
    attr_accessor :promoted,:premium,: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

5 entries across 5 versions & 1 rubygems

Version Path
whatser-0.4.0 lib/whatser/resources/follow.rb
whatser-0.3.2 lib/whatser/resources/follow.rb
whatser-0.3.1 lib/whatser/resources/follow.rb
whatser-0.3.0 lib/whatser/resources/follow.rb
whatser-0.2.0 lib/whatser/resources/follow.rb