Class: Tinybucket::Model::Commit
- Defined in:
- lib/tinybucket/model/commit.rb
Overview
Commit Resource
Constant Summary
Constants included from Constants
Constants::MISSING_REPOSITORY_KEY
Instance Attribute Summary collapse
- #author ⇒ Hash
- #date ⇒ String
- #hash ⇒ String
- #links ⇒ Hash
- #message ⇒ String
- #parents ⇒ Array
- #participants ⇒ Array
- #repository ⇒ Hash
- #type ⇒ String
- #uuid ⇒ NillClass
Instance Method Summary collapse
-
#approve(options = {}) ⇒ true, false
Give approval on this commit.
-
#build_status(key, options = {}) ⇒ Tinybucket::Model::BuildStatus?
Get the specific build status which associate with key.
-
#build_statuses(options = {}) ⇒ Tinybucket::Resource::Commit::BuildStatuses
Get build status resource.
-
#comment(comment_id, options = {}) ⇒ Tinybucket::Model::Comment
Get the specific commit comment which associate with this commit.
-
#comments(options = {}) ⇒ Tinybucket::Resource::Commit::Comments
Get comments which associate with this commit.
-
#unapprove(options = {}) ⇒ true, false
Revoke approval on this commit.
Methods inherited from Base
#attributes, #attributes=, concern_included?, #initialize
Constructor Details
This class inherits a constructor from Tinybucket::Model::Base
Instance Attribute Details
#author ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#date ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#hash ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#links ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#message ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#parents ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#participants ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#repository ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#type ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) end def commit_api create_api('Commits', repo_keys) end def load_model commit_api.find(hash) end end |
#uuid ⇒ 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( = {}) comments_resource() 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, = {}) comments_resource.find(comment_id, ) end # Give approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def approve( = {}) commit_api.approve(hash, ) end # Revoke approval on this commit. # # @param options [Hash] # @return [true] # @return [false] def unapprove( = {}) commit_api.unapprove(hash, ) end # Get build status resource # # @param options [Hash] # @return [Tinybucket::Resource::Commit::BuildStatuses] def build_statuses( = {}) build_statuses_resource() 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, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end private def comments_resource( = {}) Tinybucket::Resource::Commit::Comments.new(self, ) end def build_statuses_resource( = {}) Tinybucket::Resource::Commit::BuildStatuses.new(self, ) 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.
62 63 64 |
# File 'lib/tinybucket/model/commit.rb', line 62 def approve( = {}) commit_api.approve(hash, ) end |
#build_status(key, options = {}) ⇒ Tinybucket::Model::BuildStatus?
Get the specific build status which associate with key.
89 90 91 92 93 |
# File 'lib/tinybucket/model/commit.rb', line 89 def build_status(key, = {}) build_statuses_resource.find(key, ) rescue Tinybucket::Error::NotFound nil end |
#build_statuses(options = {}) ⇒ Tinybucket::Resource::Commit::BuildStatuses
Get build status resource
79 80 81 |
# File 'lib/tinybucket/model/commit.rb', line 79 def build_statuses( = {}) build_statuses_resource() end |
#comment(comment_id, options = {}) ⇒ Tinybucket::Model::Comment
Get the specific commit comment which associate with this commit.
53 54 55 |
# File 'lib/tinybucket/model/commit.rb', line 53 def comment(comment_id, = {}) comments_resource.find(comment_id, ) end |
#comments(options = {}) ⇒ Tinybucket::Resource::Commit::Comments
Get comments which associate with this commit.
44 45 46 |
# File 'lib/tinybucket/model/commit.rb', line 44 def comments( = {}) comments_resource() end |
#unapprove(options = {}) ⇒ true, false
Revoke approval on this commit.
71 72 73 |
# File 'lib/tinybucket/model/commit.rb', line 71 def unapprove( = {}) commit_api.unapprove(hash, ) end |