Class: Tinybucket::Model::Comment

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

Overview

Comment

See Also:

Instance Attribute Summary collapse

Method Summary

Methods inherited from Base

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

Constructor Details

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

Instance Attribute Details

#commented_to ⇒ Tinybucket::Model::PullRequest, Tinybucket::Model::Commit



39
40
41
# File 'lib/tinybucket/model/comment.rb', line 39

def commented_to
  @commented_to
end

#content ⇒ Hash

Returns:

  • (Hash)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#created_on ⇒ String

Returns:

  • (String)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#filename ⇒ String

Returns:

  • (String)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#id ⇒ Fixnum

Returns:

  • (Fixnum)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#inline ⇒ Hash

Returns:

  • (Hash)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

Returns:

  • (Hash)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#parent ⇒ Hash

Returns:

  • (Hash)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#updated_on ⇒ String

Returns:

  • (String)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#user ⇒ Hash

Returns:

  • (Hash)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end

#uuid ⇒ NillClass

Returns:

  • (NillClass)


30
31
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
# File 'lib/tinybucket/model/comment.rb', line 30

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

  acceptable_attributes \
    :links, :id, :parent, :filename, :content, :user, :inline, \
    :created_on, :updated_on, :uuid

  # @!attribute [rw] commented_to
  #   @return [Tinybucket::Model::PullRequest, Tinybucket::Model::Commit]
  attr_accessor :commented_to

  private

  def commit_api
    create_api('Comments', repo_keys)
  end

  def pull_request_api
    create_api('PullRequests', repo_keys)
  end

  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
end