Class: HubbleObservatory::TalentAccount

Inherits:
Object
  • Object
show all
Defined in:
lib/hubble_observatory/talent_account.rb

Overview

Provides methods to interact with the Hubble API talent-accounts endpoint

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:) ⇒ TalentAccount

Returns a new instance of TalentAccount


6
7
8
# File 'lib/hubble_observatory/talent_account.rb', line 6

def initialize(id:)
  @hubble_uuid = id
end

Class Method Details

.create(email:) ⇒ String

Returns the hubble uuid associated with the email

Returns:

  • (String)

    the hubble uuid associated with the email


11
12
13
14
# File 'lib/hubble_observatory/talent_account.rb', line 11

def self.create(email:)
  data = parse process_request(route: "talent-accounts", body_attrs: {email: email}, request_type: "post")
  (data)
end

Instance Method Details

#update(email:) ⇒ String

Returns the hubble uuid associated with the email

Returns:

  • (String)

    the hubble uuid associated with the email


17
18
19
20
# File 'lib/hubble_observatory/talent_account.rb', line 17

def update(email:)
  data = self.class.parse self.class.process_request(route: "talent-accounts/#{@hubble_uuid}", body_attrs: {email: email}, request_type: "put")
  self.class.(data)
end