Sha256: 498ca297ccccdbf39f6366267b6fb56d21035283ab2f22eea839eb978eb87a3d
Contents?: true
Size: 1.5 KB
Versions: 7
Compression:
Stored size: 1.5 KB
Contents
# encoding: utf-8 module Github class Issues::Events < API # Creates new Issues::Events API def initialize(options = {}) super(options) end # List events for an issue # # = Examples # github = Github.new # github.issues.events.list 'user-name', 'repo-name', 'issue-id' # # List events for a repository # # = Examples # github = Github.new # github.issues.events.list 'user-name', 'repo-name' # def list(user_name, repo_name, issue_id=nil, params={}) _update_user_repo_params(user_name, repo_name) _validate_user_repo_params(user, repo) unless user? && repo? _normalize_params_keys(params) response = if issue_id get_request("/repos/#{user}/#{repo}/issues/#{issue_id}/events", params) else get_request("/repos/#{user}/#{repo}/issues/events", params) end return response unless block_given? response.each { |el| yield el } end alias :all :list # Get a single event # # = Examples # github = Github.new # github.issues.events.get 'user-name', 'repo-name', 'event-id' # def get(user_name, repo_name, event_id, params={}) _update_user_repo_params(user_name, repo_name) _validate_user_repo_params(user, repo) unless user? && repo? _validate_presence_of event_id _normalize_params_keys(params) get_request("/repos/#{user}/#{repo}/issues/events/#{event_id}") end alias :find :get end # Issues::Events end # Github
Version data entries
7 entries across 7 versions & 1 rubygems