Class: KB::HubspotRelationship

Inherits:
BaseModel show all
Includes:
Queryable
Defined in:
lib/kb/models/hubspot_relationship.rb

Constant Summary collapse

STRING_FIELDS =
%i[kb_key hubspot_id].freeze
DATE_FIELDS =
%i[last_updated_at].freeze
FIELDS =
[*STRING_FIELDS, *DATE_FIELDS].freeze

Instance Attribute Summary

Attributes inherited from BaseModel

#persisted

Class Method Summary collapse

Methods inherited from BaseModel

#==, define_attribute_methods, define_attributes, #initialize, #persist!, #persisted?

Methods included from Inspectionable

#inspect

Constructor Details

This class inherits a constructor from KB::BaseModel

Class Method Details

.find(model, model_key) ⇒ Object



22
23
24
25
26
27
# File 'lib/kb/models/hubspot_relationship.rb', line 22

def self.find(model, model_key)
  response = kb_client.request("#{model}/#{model_key}/relationship")
  new(attributes_from_response(response))
rescue Faraday::Error => e
  raise KB::Error.from_faraday(e)
end