Class: ActiveBugzilla::Comment

Inherits:
Base
  • Object
show all
Defined in:
lib/active_bugzilla/comment.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

service, service=

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 = normalize_timestamp attributes['creation_time']
  @updated_on = normalize_timestamp attributes['time']
  @private    = attributes['is_private']
end

Instance Attribute Details

#bug_idObject (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

#countObject (readonly)

Returns the value of attribute count.



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

def count
  @count
end

#created_byObject (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_onObject (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_idObject (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

#idObject (readonly)

Returns the value of attribute id.



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

def id
  @id
end

#privateObject (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

#textObject (readonly)

Returns the value of attribute text.



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

def text
  @text
end

#updated_onObject (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