Class: HelpScout::Conversation
- Defined in:
- lib/help_scout/conversation.rb
Constant Summary collapse
- BASIC_ATTRIBUTES =
%i[ id number type folder_id status state subject preview mailbox_id assignee created_by created_at closed_by closed_at user_updated_at customer_waiting_since source tags cc bcc primary_customer custom_fields ].freeze
Instance Attribute Summary collapse
-
#hrefs ⇒ Object
readonly
Returns the value of attribute hrefs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(params) ⇒ Conversation
constructor
A new instance of Conversation.
- #populated_threads ⇒ Object
- #update(operation, path, value = nil) ⇒ Object
- #update_tags(new_tags = nil) ⇒ Object
Methods included from Getable
Methods included from Listable
Methods inherited from Base
Constructor Details
#initialize(params) ⇒ Conversation
Returns a new instance of Conversation.
53 54 55 56 57 58 59 60 61 |
# File 'lib/help_scout/conversation.rb', line 53 def initialize(params) BASIC_ATTRIBUTES.each do |attribute| next unless params[attribute] instance_variable_set("@#{attribute}", params[attribute]) end @hrefs = HelpScout::Util.map_links(params.fetch(:_links, [])) end |
Instance Attribute Details
#hrefs ⇒ Object (readonly)
Returns the value of attribute hrefs.
51 52 53 |
# File 'lib/help_scout/conversation.rb', line 51 def hrefs @hrefs end |
Class Method Details
.create(params) ⇒ Object
9 10 11 12 |
# File 'lib/help_scout/conversation.rb', line 9 def create(params) response = HelpScout.api.post(create_path, HelpScout::Util.camelize_keys(params)) response.location end |
Instance Method Details
#populated_threads ⇒ Object
63 64 65 |
# File 'lib/help_scout/conversation.rb', line 63 def populated_threads @_populated_threads ||= HelpScout::Thread.list(id) end |