Sha256: f52c79397a2a2622ad1e0d0b39b5a69ad4d64af7c39aa6ccc99e25d0ffe5c586
Contents?: true
Size: 677 Bytes
Versions: 74
Compression:
Stored size: 677 Bytes
Contents
module Services module Hubspot module Contacts class GetPage def initialize(limit: 10) @limit = limit end def call basic_api = ::Hubspot::Crm::Contacts::BasicApi.new results = basic_api.get_page(auth_names: 'oauth2', limit: @limit).results results = add_fullnames(results) end private def add_fullnames(contacts) contacts.each do |contact| fullname = [contact.properties['firstname'], contact.properties['lastname']].reject(&:empty?).join(' ') contact.properties['fullname'] = fullname end end end end end end
Version data entries
74 entries across 21 versions & 1 rubygems