Class: ActiveBugzilla::Comment
- Defined in:
- lib/active_bugzilla/comment.rb
Instance Attribute Summary collapse
-
#bug_id ⇒ Object
readonly
Returns the value of attribute bug_id.
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#created_by ⇒ Object
readonly
Returns the value of attribute created_by.
-
#created_on ⇒ Object
readonly
Returns the value of attribute created_on.
-
#creator_id ⇒ Object
readonly
Returns the value of attribute creator_id.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#private ⇒ Object
(also: #private?)
readonly
Returns the value of attribute private.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
-
#updated_on ⇒ Object
readonly
Returns the value of attribute updated_on.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attributes) ⇒ Comment
constructor
A new instance of Comment.
Methods inherited from Base
Constructor Details
#initialize(attributes) ⇒ Comment
Returns a new instance of Comment.
6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/active_bugzilla/comment.rb', line 6 def initialize(attributes) @created_by = attributes['author'] @bug_id = attributes['bug_id'] @count = attributes['count'] @creator_id = attributes['creator_id'] @id = attributes['id'] @text = attributes['text'] @created_on = attributes['creation_time'] @updated_on = attributes['time'] @private = attributes['is_private'] end |
Instance Attribute Details
#bug_id ⇒ Object (readonly)
Returns the value of attribute bug_id.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def bug_id @bug_id end |
#count ⇒ Object (readonly)
Returns the value of attribute count.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def count @count end |
#created_by ⇒ Object (readonly)
Returns the value of attribute created_by.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def created_by @created_by end |
#created_on ⇒ Object (readonly)
Returns the value of attribute created_on.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def created_on @created_on end |
#creator_id ⇒ Object (readonly)
Returns the value of attribute creator_id.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def creator_id @creator_id end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def id @id end |
#private ⇒ Object (readonly) Also known as: private?
Returns the value of attribute private.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def private @private end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def text @text end |
#updated_on ⇒ Object (readonly)
Returns the value of attribute updated_on.
3 4 5 |
# File 'lib/active_bugzilla/comment.rb', line 3 def updated_on @updated_on end |
Class Method Details
.instantiate_from_raw_data(data) ⇒ Object
19 20 21 |
# File 'lib/active_bugzilla/comment.rb', line 19 def self.instantiate_from_raw_data(data) data.sort_by(&:count).collect { |hash| new(hash) } end |