Class: Citrix::Training::Serializer::Registrant

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Initializer

#initialize

Instance Attribute Details

#attributesObject

Set attributes that can be (de)serialized.



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

def attributes
  @attributes
end

Instance Method Details

#deserializeObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/citrix/training/serializer/registrant.rb', line 18

def deserialize
  {
    first_name: attributes["givenName"],
    last_name: attributes["surname"],
    email: attributes["email"],
    join_url: attributes["joinUrl"],
    confirmation_url: attributes["confirmationUrl"],
    key: attributes["registrantKey"],
    status: attributes["status"] ? attributes["status"].downcase : nil
  }
end

#serializeObject



10
11
12
13
14
15
16
# File 'lib/citrix/training/serializer/registrant.rb', line 10

def serialize
  {
    givenName: attributes[:first_name],
    surname: attributes[:last_name],
    email: attributes[:email]
  }
end