Class: Octopi::Comment

Inherits:
Base
  • Object
show all
Includes:
Resource
Defined in:
lib/octopi/comment.rb

Constant Summary

Constants inherited from Base

Base::VALID

Instance Attribute Summary collapse

Attributes inherited from Base

#api

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Resource

for, included

Methods inherited from Base

#error=, #initialize, #property, #save

Constructor Details

This class inherits a constructor from Octopi::Base

Instance Attribute Details

#authorObject

Returns the value of attribute author.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def author
  @author
end

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def content
  @content
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def id
  @id
end

Returns the value of attribute link.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def link
  @link
end

#publishedObject

Returns the value of attribute published.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def published
  @published
end

#repositoryObject

Returns the value of attribute repository.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def repository
  @repository
end

#titleObject

Returns the value of attribute title.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def title
  @title
end

#updatedObject

Returns the value of attribute updated.



3
4
5
# File 'lib/octopi/comment.rb', line 3

def updated
  @updated
end

Class Method Details

.find(options = {}) ⇒ Object



9
10
11
12
13
14
# File 'lib/octopi/comment.rb', line 9

def self.find(options={})
  ensure_hash(options)
  user, repo, branch, sha = gather_details(options)
  self.validate_args(sha => :sha, user => :user, repo => :repo)
  super [user, repo, sha] 
end

Instance Method Details

#commitObject



16
17
18
# File 'lib/octopi/comment.rb', line 16

def commit
  Commit.find(:user => repository.owner, :repo => repository, :sha => /commit\/(.*?)#/.match(link)[1])
end