Class: YandexTracker::Collections::Comments
- Defined in:
- lib/yandex_tracker/collections/comments.rb
Overview
Collections::Comments
Instance Attribute Summary collapse
-
#issue_id ⇒ Object
readonly
Returns the value of attribute issue_id.
Attributes inherited from Base
Instance Method Summary collapse
- #create(**attributes) ⇒ Object
- #find(id) ⇒ Object
-
#initialize(client, issue_id) ⇒ Comments
constructor
A new instance of Comments.
- #list(**params) ⇒ Object
- #update(comment, **attributes) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(client, issue_id) ⇒ Comments
Returns a new instance of Comments.
11 12 13 14 15 16 17 |
# File 'lib/yandex_tracker/collections/comments.rb', line 11 def initialize(client, issue_id) raise ArgumentError, "issue_id is required" if issue_id.nil? super(client) @resource = Resources::Comment.new(client) @issue_id = issue_id end |
Instance Attribute Details
#issue_id ⇒ Object (readonly)
Returns the value of attribute issue_id.
9 10 11 |
# File 'lib/yandex_tracker/collections/comments.rb', line 9 def issue_id @issue_id end |
Instance Method Details
#create(**attributes) ⇒ Object
24 25 26 27 |
# File 'lib/yandex_tracker/collections/comments.rb', line 24 def create(**attributes) response = resource.create(issue_id, **attributes) build_object(Objects::Comment, response, { issue_id: issue_id }) end |
#find(id) ⇒ Object
19 20 21 22 |
# File 'lib/yandex_tracker/collections/comments.rb', line 19 def find(id) response = resource.find(issue_id, id) build_object(Objects::Comment, response, { issue_id: issue_id }) end |