Class: Tinybucket::Model::PullRequest

Inherits:
Base
  • Object
show all
Includes:
Constants, Concerns::RepositoryKeys
Defined in:
lib/tinybucket/model/pull_request.rb

Overview

PullRequest

Constant Summary

Constants included from Constants

Constants::MISSING_REPOSITORY_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #attributes=, concern_included?, #initialize

Constructor Details

This class inherits a constructor from Tinybucket::Model::Base

Instance Attribute Details

#authorHash

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#close_source_branchtrue, false

Returns:

  • (true, false)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#closed_byHash

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#comment_countFixnum

Returns:

  • (Fixnum)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#created_onString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#descriptionString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#destinationHash

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#idFixnum

Returns:

  • (Fixnum)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#merge_commitHash

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#participantsArray

Returns:

  • (Array)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#reasonString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#reviewersArray

Returns:

  • (Array)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#sourceHash

Returns:

  • (Hash)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#stateString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#task_countFixnum

Returns:

  • (Fixnum)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#titleString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#typeString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#updated_onString

Returns:

  • (String)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

#uuidNillClass

Returns:

  • (NillClass)

50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/tinybucket/model/pull_request.rb', line 50

class PullRequest < Base
  include Tinybucket::Model::Concerns::RepositoryKeys
  include Tinybucket::Constants

  acceptable_attributes \
    :state, :description, :links, :title, :task_count, :comment_count,
    :close_source_branch, :destination, :reason, :id, :source,
    :created_on, :author, :updated_on, :merge_commit, :closed_by,
    :reviewers, :participants, :uuid, :type

  # Update this pull request.
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def update(_params)
    raise NotImplementedError
  end

  # Decline or reject this pull request.
  #
  # @param options [Hash]
  # @return [true,false]
  def decline(options = {})
    pull_request_api.decline(id, options)
  end

  # Give approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def approve(options = {})
    pull_request_api.approve(id, options)
  end

  # Revoke approval on this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def unapprove(options = {})
    pull_request_api.unapprove(id, options)
  end

  # Get commits associated with this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get comments on this pull request.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::PullRequest::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific comment on this pull request.
  #
  # @param comment_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Get the diff for this pull request.
  #
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(options = {})
    pull_request_api.diff(id, options)
  end

  # Accept and merge this pull request.
  #
  # @param options [Hash]
  # @return [true, false]
  def merge(options = {})
    pull_request_api.merge(id, options)
  end

  # Get activities on this pull requests.
  #
  def activities(_options = {})
    raise NotImplementedError
  end

  private

  def commits_resource(options = {})
    Tinybucket::Resource::PullRequest::Commits.new(self, options)
  end

  def comments_resource(options = {})
    Tinybucket::Resource::PullRequest::Comments.new(self, options)
  end

  def pull_request_api
    raise ArgumentError, MISSING_REPOSITORY_KEY unless repo_keys?

    create_api('PullRequests', repo_keys)
  end

  def load_model
    pull_request_api.find(id)
  end
end

Instance Method Details

#activities(_options = {}) ⇒ Object

Get activities on this pull requests.

Raises:

  • (NotImplementedError)

135
136
137
# File 'lib/tinybucket/model/pull_request.rb', line 135

def activities(_options = {})
  raise NotImplementedError
end

#approve(options = {}) ⇒ true, false

Give approval on this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (true, false)

80
81
82
# File 'lib/tinybucket/model/pull_request.rb', line 80

def approve(options = {})
  pull_request_api.approve(id, options)
end

#comment(comment_id, options = {}) ⇒ Tinybucket::Model::Comment

Get the specific comment on this pull request.

Parameters:

  • comment_id (String)
  • options (Hash) (defaults to: {})

Returns:


113
114
115
# File 'lib/tinybucket/model/pull_request.rb', line 113

def comment(comment_id, options = {})
  comments_resource.find(comment_id, options)
end

#comments(options = {}) ⇒ Tinybucket::Resource::PullRequest::Comments

Get comments on this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:


104
105
106
# File 'lib/tinybucket/model/pull_request.rb', line 104

def comments(options = {})
  comments_resource(options)
end

#commits(options = {}) ⇒ Tinybucket::Resource::PullRequest::Commits

Get commits associated with this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:


96
97
98
# File 'lib/tinybucket/model/pull_request.rb', line 96

def commits(options = {})
  commits_resource(options)
end

#decline(options = {}) ⇒ true, false

Decline or reject this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (true, false)

72
73
74
# File 'lib/tinybucket/model/pull_request.rb', line 72

def decline(options = {})
  pull_request_api.decline(id, options)
end

#diff(options = {}) ⇒ String

Get the diff for this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (String)

    diff as raw text.


121
122
123
# File 'lib/tinybucket/model/pull_request.rb', line 121

def diff(options = {})
  pull_request_api.diff(id, options)
end

#merge(options = {}) ⇒ true, false

Accept and merge this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (true, false)

129
130
131
# File 'lib/tinybucket/model/pull_request.rb', line 129

def merge(options = {})
  pull_request_api.merge(id, options)
end

#unapprove(options = {}) ⇒ true, false

Revoke approval on this pull request.

Parameters:

  • options (Hash) (defaults to: {})

Returns:

  • (true, false)

88
89
90
# File 'lib/tinybucket/model/pull_request.rb', line 88

def unapprove(options = {})
  pull_request_api.unapprove(id, options)
end

#update(_params) ⇒ Object

TODO:

to be implemented.

Update this pull request.

Raises:

  • (NotImplementedError)

    to be implemented.


64
65
66
# File 'lib/tinybucket/model/pull_request.rb', line 64

def update(_params)
  raise NotImplementedError
end