Sha256: 3d810a41a1f60aa2f53c5b6df6fbec29fb5a13c625b33a3bdc0c684a850f4c0d

Contents?: true

Size: 847 Bytes

Versions: 2

Compression:

Stored size: 847 Bytes

Contents

module Citrix
  module Training
    module Serializer
      class Registrant
        include Helpers::Initializer

        # Set attributes that can be (de)serialized.
        attr_accessor :attributes

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

        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
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
citrix-0.2.0 lib/citrix/training/serializer/registrant.rb
citrix-0.1.0 lib/citrix/training/serializer/registrant.rb