Class: Citrix::Training::Resource::Registrant

Inherits:
Object
  • Object
show all
Includes:
Helpers::Initializer
Defined in:
lib/citrix/training/resource/registrant.rb

Constant Summary collapse

ATTRIBUTES =
%i[
  first_name
  last_name
  email
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Initializer

#initialize

Instance Attribute Details

#confirmation_urlObject

Set the confirmation url.



20
21
22
# File 'lib/citrix/training/resource/registrant.rb', line 20

def confirmation_url
  @confirmation_url
end

#emailObject

Set the e-mail.



14
15
16
# File 'lib/citrix/training/resource/registrant.rb', line 14

def email
  @email
end

#first_nameObject

Set the first name of the user.



8
9
10
# File 'lib/citrix/training/resource/registrant.rb', line 8

def first_name
  @first_name
end

#join_urlObject

Set the join url.



17
18
19
# File 'lib/citrix/training/resource/registrant.rb', line 17

def join_url
  @join_url
end

#keyObject

Set the registrant key.



23
24
25
# File 'lib/citrix/training/resource/registrant.rb', line 23

def key
  @key
end

#last_nameObject

Set the last name of the user.



11
12
13
# File 'lib/citrix/training/resource/registrant.rb', line 11

def last_name
  @last_name
end

#statusObject

Set the status.



26
27
28
# File 'lib/citrix/training/resource/registrant.rb', line 26

def status
  @status
end

Class Method Details

.deserialize(attributes) ⇒ Object

Convert ‘attributes` into parameters that Citrix::Training::Resource::Registrant can understand.



42
43
44
# File 'lib/citrix/training/resource/registrant.rb', line 42

def self.deserialize(attributes)
  Serializer::Registrant.new(attributes: attributes).deserialize
end

.serialize(attributes) ⇒ Object

Convert ‘attributes` into parameters that Citrix API can understand.



36
37
38
# File 'lib/citrix/training/resource/registrant.rb', line 36

def self.serialize(attributes)
  Serializer::Registrant.new(attributes: attributes).serialize
end

Instance Method Details

#attributesObject

Return a hash containing all attributes.



47
48
49
50
51
# File 'lib/citrix/training/resource/registrant.rb', line 47

def attributes
  ATTRIBUTES.each_with_object({}) do |name, buffer|
    buffer[name] = public_send(name)
  end
end

#serializeObject

Serialize the attributes.



54
55
56
# File 'lib/citrix/training/resource/registrant.rb', line 54

def serialize
  self.class.serialize(attributes)
end