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

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

Constant Summary collapse

ATTRIBUTES =
%i[
  name
  description
  timezone
  web_registration
  confirmation_email
  organizers
  dates
]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Initializer

#initialize

Instance Attribute Details

#confirmation_emailObject

Set confirmation e-mail delivery.



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

def confirmation_email
  @confirmation_email
end

#datesObject

Set the dates.



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

def dates
  @dates
end

#descriptionObject

Set the description of the training.



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

def description
  @description
end

#keyObject

Set the training key.



29
30
31
# File 'lib/citrix/training/resource/training.rb', line 29

def key
  @key
end

#nameObject

Set the name of the training.



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

def name
  @name
end

#organizersObject

Set the organizers.



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

def organizers
  @organizers
end

#timezoneObject

Set the timezone.



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

def timezone
  @timezone
end

#web_registrationObject

Set web registration.



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

def web_registration
  @web_registration
end

Class Method Details

.deserialize(attributes) ⇒ Object

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



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

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

.serialize(attributes) ⇒ Object

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



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

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

Instance Method Details

#attributesObject

Return a hash containing all attributes.



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

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

#serializeObject

Serialize the attributes.



61
62
63
# File 'lib/citrix/training/resource/training.rb', line 61

def serialize
  self.class.serialize(attributes)
end