Class: Crm::Activity::Comment

Inherits:
Object
  • Object
show all
Includes:
Core::Mixins::AttributeProvider
Defined in:
lib/crm/activity.rb

Overview

Comment represents a comment of an Activity, for example a single comment of a support case discussion.

Defined Under Namespace

Classes: Attachment

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::Mixins::AttributeProvider

#[], #attributes, #method_missing, #methods, #raw, #respond_to_missing?

Constructor Details

#initialize(raw_comment) ⇒ Comment

Returns a new instance of Comment.



76
77
78
79
80
81
82
# File 'lib/crm/activity.rb', line 76

def initialize(raw_comment)
  comment = raw_comment.dup
  comment['attachments'] = raw_comment['attachments'].map{ |attachment_id|
    Attachment.new(attachment_id)
  }
  super(comment)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Crm::Core::Mixins::AttributeProvider

Instance Attribute Details

#attachmentsArray<Attachment> (readonly)

Returns the list of comment attachments.

Returns:



# File 'lib/crm/activity.rb', line 84

#notesString (readonly)

Returns the comment text.

Returns:

  • (String)


# File 'lib/crm/activity.rb', line 99

#published?Boolean (readonly)

Returns whether the comment is published.

Returns:

  • (Boolean)


108
109
110
# File 'lib/crm/activity.rb', line 108

def published?
  published
end

#updated_atTime (readonly)

Returns the timestamp of the comment.

Returns:

  • (Time)


# File 'lib/crm/activity.rb', line 89

#updated_byString (readonly)

Returns the login of the API user who created the comment.

Returns:

  • (String)


# File 'lib/crm/activity.rb', line 94