Class: GitHubRecordsArchiver::Comment
- Inherits:
-
Object
- Object
- GitHubRecordsArchiver::Comment
- Includes:
- DataHelper
- Defined in:
- lib/github_records_archiver/comment.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
Class Method Summary collapse
Instance Method Summary collapse
- #data ⇒ Object
-
#initialize(repo, id) ⇒ Comment
constructor
A new instance of Comment.
- #to_s ⇒ Object
Methods included from DataHelper
#method_missing, #respond_to_missing?, #to_h, #to_json
Constructor Details
#initialize(repo, id) ⇒ Comment
Returns a new instance of Comment.
8 9 10 11 12 |
# File 'lib/github_records_archiver/comment.rb', line 8 def initialize(repo, id) repo = Repository.new(repo) if repo.is_a? String @repository = repo @id = id end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GitHubRecordsArchiver::DataHelper
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
4 5 6 |
# File 'lib/github_records_archiver/comment.rb', line 4 def id @id end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
3 4 5 |
# File 'lib/github_records_archiver/comment.rb', line 3 def repository @repository end |
Class Method Details
Instance Method Details
#data ⇒ Object
20 21 22 23 24 |
# File 'lib/github_records_archiver/comment.rb', line 20 def data @data ||= begin GitHubRecordsArchiver.client.issue_comment(repository.full_name, id) end end |
#to_s ⇒ Object
26 27 28 29 30 |
# File 'lib/github_records_archiver/comment.rb', line 26 def to_s output = "@#{user[:login]} at #{created_at} wrote:\n\n" output << body output end |