Class: Hubspot::ConversationThread

Inherits:
Object
  • Object
show all
Defined in:
lib/hubspot/conversation_thread.rb

Overview

Constant Summary collapse

THREAD_PATH =
'/conversations/v3/conversations/threads/:thread_id'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response_hash) ⇒ ConversationThread



14
15
16
17
# File 'lib/hubspot/conversation_thread.rb', line 14

def initialize(response_hash)
  @id = response_hash['id']
  @properties = response_hash.deep_symbolize_keys
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



12
13
14
# File 'lib/hubspot/conversation_thread.rb', line 12

def id
  @id
end

#propertiesObject (readonly)

Returns the value of attribute properties.



12
13
14
# File 'lib/hubspot/conversation_thread.rb', line 12

def properties
  @properties
end

Class Method Details

.find(thread_id, with_associations: false) ⇒ Object



20
21
22
23
24
# File 'lib/hubspot/conversation_thread.rb', line 20

def find(thread_id, with_associations: false)
  association = with_associations ? ['TICKET'] : []
  response = Hubspot::Connection.get_json(THREAD_PATH, thread_id:, association:)
  new(response)
end