Class: Hubspot

Inherits:
Object
  • Object
show all
Includes:
Constants, ErrorHandler
Defined in:
lib/ruby_hubspot/hubspot.rb

Overview

Hubspot main

Constant Summary

Constants included from Constants

Constants::API_URL, Constants::AUTHORIZATION_KEY, Constants::CONTENT_TYPE

Constants included from ErrorHandler

ErrorHandler::ACCESS_TOKEN_ERROR

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token:) ⇒ Hubspot

Returns a new instance of Hubspot.



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

def initialize(access_token:)
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



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

def access_token
  @access_token
end

Instance Method Details

#request(http_method, path, **params) ⇒ Object



18
19
20
21
22
# File 'lib/ruby_hubspot/hubspot.rb', line 18

def request(http_method, path, **params)
  validate_access_token

  response(http_method, path, params)
end