class Tinybucket::Model::Comment

Comment

@see developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/commit/%7Bsha%7D/comments

Comment Resource

@!attribute [rw] links

@return [Hash]

@!attribute [rw] id

@return [Fixnum]

@!attribute [rw] parent

@return [Hash]

@!attribute [rw] filename

@return [String]

@!attribute [rw] content

@return [Hash]

@!attribute [rw] user

@return [Hash]

@!attribute [rw] inline

@return [Hash]

@!attribute [rw] created_on

@return [String]

@!attribute [rw] updated_on

@return [String]

@!attribute [rw] uuid

@return [NillClass]

Attributes

commented_to[RW]

@!attribute [rw] commented_to

@return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]

Private Instance Methods

commit_api() click to toggle source
# File lib/tinybucket/model/comment.rb, line 43
def commit_api
  create_api('Comments', repo_keys)
end
load_model() click to toggle source
# File lib/tinybucket/model/comment.rb, line 51
def load_model
  api =
    case commented_to
    when Tinybucket::Model::Commit
      commit_api
    when Tinybucket::Model::PullRequest
      pull_request_api
    else
      raise ArgumentError, 'commented_to was invalid'
    end

  api.commented_to = commented_ato
  api.find(id, {})
end
pull_request_api() click to toggle source
# File lib/tinybucket/model/comment.rb, line 47
def pull_request_api
  create_api('PullRequests', repo_keys)
end