Class: Tinybucket::Model::Repository

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

Overview

Repository

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#attributes, #attributes=, concern_included?

Constructor Details

#initialize(json) ⇒ Repository



57
58
59
60
61
62
# File 'lib/tinybucket/model/repository.rb', line 57

def initialize(json)
  super(json)

  return unless full_name && full_name.split('/').size == 2
  @repo_owner, @repo_slug = full_name.split('/')
end

Instance Attribute Details

#created_onString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#descriptionString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#fork_policyString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#full_nameString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#has_issuestrue, false



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#has_wikitrue, false



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#is_privatetrue, false



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#languageString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end


48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#nameString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#ownerHash



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#parentHash, NillClass



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#projectHash



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#scmString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#sizeFixnum



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#typeString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#updated_onString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#uuidString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

#websiteString



48
49
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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
# File 'lib/tinybucket/model/repository.rb', line 48

class Repository < Base
  include Tinybucket::Model::Concerns::RepositoryKeys

  acceptable_attributes \
    :scm, :has_wiki, :description, :links, :updated_on,
    :fork_policy, :created_on, :owner, :size, :parent, :uuid,
    :has_issues, :is_private, :full_name, :name, :language,
    :website, :type, :project

  def initialize(json)
    super(json)

    return unless full_name && full_name.split('/').size == 2
    @repo_owner, @repo_slug = full_name.split('/')
  end

  # Remove this repository
  #
  # @todo to be implemented.
  # @raise [NotImplementedError] to be implemented.
  def destroy
    raise NotImplementedError
  end

  # Get pull requests on thie repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Enumerator] an enumerator to enumerate
  #   pull requests as {Tinybucket::Model::PullRequest} instance.
  def pull_requests(options = {})
    pull_requests_resource(options)
  end

  # Get the specific pull request on this repository.
  #
  # @param pullrequest_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::PullRequest]
  def pull_request(pullrequest_id, options = {})
    pull_requests_resource.find(pullrequest_id, options)
  end

  # Get watchers on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Watchers]
  def watchers(options = {})
    watchers_resource(options)
  end

  # Get repository forks.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Forks]
  def forks(options = {})
    forks_resource(options)
  end

  # Get commits on this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commits]
  def commits(options = {})
    commits_resource(options)
  end

  # Get the specific commit on this repository.
  #
  # @param revision [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Commit]
  def commit(revision, options = {})
    commits_resource.find(revision, options)
  end

  # Get branches on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Branches]
  def branches(options = {})
    branches_resource(options)
  end

  # Get issues on this repository
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Issues]
  def issues(options = {})
    issues_resource(options)
  end

  # Get the specific branch on this repository.
  #
  # @param branch [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::Branches]
  def branch(branch, options = {})
    branches_resource.find(branch, options)
  end

  # Get the branch restriction information associated with this repository.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::BranchRestrictions]
  def branch_restrictions(options = {})
    branch_restrictions_resource(options)
  end

  # Get the specific branch restriction information on this repository.
  #
  # @param restriction_id [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BranchRestriction]
  def branch_restriction(restriction_id, options = {})
    branch_restrictions_resource.find(restriction_id, options)
  end

  # Get the diff for this repository.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @param options [Hash]
  # @return [String] diff as raw text.
  def diff(spec, options = {})
    diff_api.find(spec, options)
  end

  # Get the patch for the specification.
  #
  # @param spec [String] A specification such as a branch name,
  #   revision, or commit SHA.
  # @return [String] patch as raw text.
  def patch(spec, options = {})
    diff_api.find_patch(spec, options)
  end

  private

  def branch_restrictions_resource(options = {})
    Tinybucket::Resource::BranchRestrictions.new(self, options)
  end

  def branches_resource(options = {})
    Tinybucket::Resource::Branches.new(self, options)
  end

  def issues_resource(options = {})
    Tinybucket::Resource::Issues.new(self, options)
  end

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

  def hooks_resource(options = {})
    Tinybucket::Resource::Hooks.new(self, options)
  end

  def pull_requests_resource(options = {})
    Tinybucket::Resource::PullRequests.new(self, options)
  end

  def watchers_resource(options = {})
    Tinybucket::Resource::Watchers.new(self, options)
  end

  def forks_resource(options = {})
    Tinybucket::Resource::Forks.new(self, options)
  end

  def repo_api
    create_api('Repo', repo_keys)
  end

  def diff_api
    create_api('Diff', repo_keys)
  end

  def load_model
    repo_api.find()
  end
end

Instance Method Details

#branch(branch, options = {}) ⇒ Tinybucket::Model::Branches

Get the specific branch on this repository.



144
145
146
# File 'lib/tinybucket/model/repository.rb', line 144

def branch(branch, options = {})
  branches_resource.find(branch, options)
end

#branch_restriction(restriction_id, options = {}) ⇒ Tinybucket::Model::BranchRestriction

Get the specific branch restriction information on this repository.



161
162
163
# File 'lib/tinybucket/model/repository.rb', line 161

def branch_restriction(restriction_id, options = {})
  branch_restrictions_resource.find(restriction_id, options)
end

#branch_restrictions(options = {}) ⇒ Tinybucket::Resource::BranchRestrictions

Get the branch restriction information associated with this repository.



152
153
154
# File 'lib/tinybucket/model/repository.rb', line 152

def branch_restrictions(options = {})
  branch_restrictions_resource(options)
end

#branches(options = {}) ⇒ Tinybucket::Resource::Branches

Get branches on this repository



127
128
129
# File 'lib/tinybucket/model/repository.rb', line 127

def branches(options = {})
  branches_resource(options)
end

#commit(revision, options = {}) ⇒ Tinybucket::Model::Commit

Get the specific commit on this repository.



119
120
121
# File 'lib/tinybucket/model/repository.rb', line 119

def commit(revision, options = {})
  commits_resource.find(revision, options)
end

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

Get commits on this repository.



110
111
112
# File 'lib/tinybucket/model/repository.rb', line 110

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

#destroyObject

TODO:

to be implemented.

Remove this repository

Raises:

  • (NotImplementedError)

    to be implemented.



68
69
70
# File 'lib/tinybucket/model/repository.rb', line 68

def destroy
  raise NotImplementedError
end

#diff(spec, options = {}) ⇒ String

Get the diff for this repository.



171
172
173
# File 'lib/tinybucket/model/repository.rb', line 171

def diff(spec, options = {})
  diff_api.find(spec, options)
end

#forks(options = {}) ⇒ Tinybucket::Resource::Forks

Get repository forks.



102
103
104
# File 'lib/tinybucket/model/repository.rb', line 102

def forks(options = {})
  forks_resource(options)
end

#issues(options = {}) ⇒ Tinybucket::Resource::Issues

Get issues on this repository



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

def issues(options = {})
  issues_resource(options)
end

#patch(spec, options = {}) ⇒ String

Get the patch for the specification.



180
181
182
# File 'lib/tinybucket/model/repository.rb', line 180

def patch(spec, options = {})
  diff_api.find_patch(spec, options)
end

#pull_request(pullrequest_id, options = {}) ⇒ Tinybucket::Model::PullRequest

Get the specific pull request on this repository.



86
87
88
# File 'lib/tinybucket/model/repository.rb', line 86

def pull_request(pullrequest_id, options = {})
  pull_requests_resource.find(pullrequest_id, options)
end

#pull_requests(options = {}) ⇒ Tinybucket::Enumerator

Get pull requests on thie repository.



77
78
79
# File 'lib/tinybucket/model/repository.rb', line 77

def pull_requests(options = {})
  pull_requests_resource(options)
end

#watchers(options = {}) ⇒ Tinybucket::Resource::Watchers

Get watchers on this repository.



94
95
96
# File 'lib/tinybucket/model/repository.rb', line 94

def watchers(options = {})
  watchers_resource(options)
end