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

#author ⇒ Object

Returns the value of attribute author.



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

def author
  @author
end

#content ⇒ Object

Returns the value of attribute content.



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

def content
  @content
end

#id ⇒ Object

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

#published ⇒ Object

Returns the value of attribute published.



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

def published
  @published
end

#repository ⇒ Object

Returns the value of attribute repository.



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

def repository
  @repository
end

#title ⇒ Object

Returns the value of attribute title.



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

def title
  @title
end

#updated ⇒ Object

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

#commit ⇒ Object



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