Sha256: 02784d06f88844a115aafe0086abda494fea0a704d9aa1c635c585cddcdf22c4

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 KB

Contents

# encoding: utf-8

module Github
  class Client::Activity::Feeds < API
    # List all the feeds available to the authenticated user.
    #
    # @see https://developer.github.com/v3/activity/feeds/#list-feeds
    #
    # @example
    #   github = Github.new
    #   github.activity.feeds.list
    #
    # @api public
    def list(*args)
      arguments(args)

      response = get_request("/feeds", arguments.params)
      return response unless block_given?
      response.each { |el| yield el }
    end
    alias_method :all, :list

    # Get all the items for a named timeline
    #
    # @see https://developer.github.com/v3/activity/feeds/#list-feeds
    #
    # @example
    #   github = Github.new
    #   github.activity.feeds.get "timeline"
    #
    # @param [String] name
    #   the name of the timeline resource
    #
    # @api public
    def get(*args)
      arguments(args, required: [:name])

      name = arguments.name
      response = list.body._links[name]
      if response
        params = arguments.params
        params['accept'] = response.type
        get_request(response.href, params)
      end
    end
    alias_method :find, :get
  end
end # Github

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
github_api-0.17.0 lib/github_api/client/activity/feeds.rb
github_api-0.16.0 lib/github_api/client/activity/feeds.rb
github_api-0.15.0 lib/github_api/client/activity/feeds.rb
github_api-0.14.5 lib/github_api/client/activity/feeds.rb
github_api-0.14.4 lib/github_api/client/activity/feeds.rb
github_api-0.14.3 lib/github_api/client/activity/feeds.rb
github_api-0.14.2 lib/github_api/client/activity/feeds.rb
github_api-0.14.1 lib/github_api/client/activity/feeds.rb
github_api-0.14.0 lib/github_api/client/activity/feeds.rb