Class: Tinybucket::Model::Commit

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

Overview

Commit Resource

Constant Summary

Constants included from Constants

Constants::MISSING_REPOSITORY_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

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

Instance Attribute Details

#authorHash

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#dateString

Returns:

  • (String)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#hashString

Returns:

  • (String)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#messageString

Returns:

  • (String)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#parentsArray

Returns:

  • (Array)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#participantsArray

Returns:

  • (Array)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#repositoryHash

Returns:

  • (Hash)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#typeString

Returns:

  • (String)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

#uuidNillClass

Returns:

  • (NillClass)


32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
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
# File 'lib/tinybucket/model/commit.rb', line 32

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

  acceptable_attributes \
    :hash, :links, :repository, :author, :parents, :date,
    :message, :participants, :uuid, :type

  # Get comments which associate with this commit.
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::Comments]
  def comments(options = {})
    comments_resource(options)
  end

  # Get the specific commit comment which associate with this commit.
  #
  # @param comment_id [String] comment id
  # @param options [Hash]
  # @return [Tinybucket::Model::Comment]
  def comment(comment_id, options = {})
    comments_resource.find(comment_id, options)
  end

  # Give approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def approve(options = {})
    commit_api.approve(hash, options)
  end

  # Revoke approval on this commit.
  #
  # @param options [Hash]
  # @return [true]
  # @return [false]
  def unapprove(options = {})
    commit_api.unapprove(hash, options)
  end

  # Get build status resource
  #
  # @param options [Hash]
  # @return [Tinybucket::Resource::Commit::BuildStatuses]
  def build_statuses(options = {})
    build_statuses_resource(options)
  end

  # Get the specific build status which associate with key.
  #
  # @param key [String]
  # @param options [Hash]
  # @return [Tinybucket::Model::BuildStatus]
  # @return [nil] when build_status does not found.
  def build_status(key, options = {})
    build_statuses_resource.find(key, options)
  rescue Tinybucket::Error::NotFound
    nil
  end

  private

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

  def build_statuses_resource(options = {})
    Tinybucket::Resource::Commit::BuildStatuses.new(self, options)
  end

  def commit_api
    create_api('Commits', repo_keys)
  end

  def load_model
    commit_api.find(hash)
  end
end

Instance Method Details

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

Give approval on this commit.

Parameters:

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

Returns:

  • (true)
  • (false)


62
63
64
# File 'lib/tinybucket/model/commit.rb', line 62

def approve(options = {})
  commit_api.approve(hash, options)
end

#build_status(key, options = {}) ⇒ Tinybucket::Model::BuildStatus?

Get the specific build status which associate with key.

Parameters:

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

Returns:



89
90
91
92
93
# File 'lib/tinybucket/model/commit.rb', line 89

def build_status(key, options = {})
  build_statuses_resource.find(key, options)
rescue Tinybucket::Error::NotFound
  nil
end

#build_statuses(options = {}) ⇒ Tinybucket::Resource::Commit::BuildStatuses

Get build status resource

Parameters:

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

Returns:



79
80
81
# File 'lib/tinybucket/model/commit.rb', line 79

def build_statuses(options = {})
  build_statuses_resource(options)
end

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

Get the specific commit comment which associate with this commit.

Parameters:

  • comment_id (String)

    comment id

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

Returns:



53
54
55
# File 'lib/tinybucket/model/commit.rb', line 53

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

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

Get comments which associate with this commit.

Parameters:

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

Returns:



44
45
46
# File 'lib/tinybucket/model/commit.rb', line 44

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

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

Revoke approval on this commit.

Parameters:

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

Returns:

  • (true)
  • (false)


71
72
73
# File 'lib/tinybucket/model/commit.rb', line 71

def unapprove(options = {})
  commit_api.unapprove(hash, options)
end