Class: Projects::Model::Event
- Inherits:
-
Object
- Object
- Projects::Model::Event
- Defined in:
- lib/projects/model/Event.rb
Overview
-
This class is used to make an object for Event.
Instance Attribute Summary collapse
-
#isOpen ⇒ Object
readonly
-
Get the event is open or not.
-
Instance Method Summary collapse
-
#getAMPM ⇒ Object
-
Get AM or PM for the event.
-
-
#getDurationHours ⇒ Object
-
Get the duration hour for the event.
-
-
#getDurationMinutes ⇒ Object
-
Get the duration minutes for the event.
-
-
#getHour ⇒ Object
-
Get the hour for the event.
-
-
#getId ⇒ Object
-
Get the event id.
-
-
#getLocation ⇒ Object
-
Get the event location.
-
-
#getMinutes ⇒ Object
-
Get the minutes for the event.
-
-
#getOccurred ⇒ Object
-
Get no of times occurred for the reminder.
-
-
#getOccurrences ⇒ Object
-
Get the occurrences for the reminder.
-
-
#getParticipants ⇒ Object
-
Get the participants.
-
-
#getReminder ⇒ Object
-
Get the reminder for the event.
-
-
#getRepeat ⇒ Object
-
Get the reminder repeat for the event.
-
-
#getScheduledOn ⇒ Object
-
Get the event scheduled on.
-
-
#getScheduledOnLong ⇒ Object
-
Get the event scheduled on long.
-
-
#getTilte ⇒ Object
-
Get the event title.
-
-
#setAMPM(ampm) ⇒ Object
-
Set AM or PM for the event.
-
-
#setDurationHours(durationHour) ⇒ Object
-
Set the duration hour.
-
-
#setDurationMinutes(durationMinutes) ⇒ Object
-
Set the duration minutes for the event.
-
-
#setHour(hour) ⇒ Object
-
Set the hour for the event.
-
-
#setId(id) ⇒ Object
-
Set the event id.
-
-
#setIsOpen(isOpen) ⇒ Object
-
Set the event is open or not.
-
-
#setLocation(location) ⇒ Object
-
Set the event location.
-
-
#setMinutes(minutes) ⇒ Object
-
Set the minutes for the event.
-
-
#setOccurred(occurred) ⇒ Object
-
Set no of times occurred for the reminder.
-
-
#setOccurrences(occurrences) ⇒ Object
-
Set the occurrences for the reminder.
-
-
#setParticipants(participants) ⇒ Object
-
Set the participants.
-
-
#setReminder(reminder) ⇒ Object
-
Set the reminder for the event.
-
-
#setRepeat(repeat) ⇒ Object
-
Set the reminder repeat for the event.
-
-
#setScheduledOn(scheduledOn) ⇒ Object
-
Set the event scheduled on.
-
-
#setScheduledOnLong(scheduledOnLong) ⇒ Object
-
Set the event scheduled on long.
-
-
#setTitle(title) ⇒ Object
-
Set the event title.
-
-
#toParamMAP ⇒ Object
-
Convert the Event object into HashMap.
-
Instance Attribute Details
#isOpen ⇒ Object
-
Get the event is open or not.
Returns
-
true, if the event is open else false.
249 250 251 |
# File 'lib/projects/model/Event.rb', line 249 def isOpen @isOpen end |
Instance Method Details
#getAMPM ⇒ Object
-
Get AM or PM for the event.
Returns
-
Time format of the event in AM or PM.
329 330 331 |
# File 'lib/projects/model/Event.rb', line 329 def getAMPM return @ampm end |
#getDurationHours ⇒ Object
-
Get the duration hour for the event.
Returns
-
Event duration in hours.
209 210 211 |
# File 'lib/projects/model/Event.rb', line 209 def getDurationHours return @durationHour end |
#getDurationMinutes ⇒ Object
-
Get the duration minutes for the event.
Returns
-
Event duration in minutes.
229 230 231 |
# File 'lib/projects/model/Event.rb', line 229 def getDurationMinutes return @durationMinutes end |
#getHour ⇒ Object
-
Get the hour for the event.
Returns
-
Event hour.
289 290 291 |
# File 'lib/projects/model/Event.rb', line 289 def getHour return @hour end |
#getId ⇒ Object
-
Get the event id.
Returns
-
Event id.
29 30 31 |
# File 'lib/projects/model/Event.rb', line 29 def getId return @id end |
#getLocation ⇒ Object
-
Get the event location.
Returns
-
Event location.
69 70 71 |
# File 'lib/projects/model/Event.rb', line 69 def getLocation return @location end |
#getMinutes ⇒ Object
-
Get the minutes for the event.
Returns
-
Minutes for the event.
309 310 311 |
# File 'lib/projects/model/Event.rb', line 309 def getMinutes return @minutes end |
#getOccurred ⇒ Object
-
Get no of times occurred for the reminder.
Returns
-
No of times the reminder has occurred.
189 190 191 |
# File 'lib/projects/model/Event.rb', line 189 def getOccurred return @occurred end |
#getOccurrences ⇒ Object
-
Get the occurrences for the reminder.
Returns
-
Number of occurences of the reminder.
169 170 171 |
# File 'lib/projects/model/Event.rb', line 169 def getOccurrences return @occurrences end |
#getParticipants ⇒ Object
-
Get the participants.
Returns
-
List of Participant object.
269 270 271 |
# File 'lib/projects/model/Event.rb', line 269 def getParticipants return @participants end |
#getReminder ⇒ Object
-
Get the reminder for the event.
Returns
-
event reminder.
129 130 131 |
# File 'lib/projects/model/Event.rb', line 129 def getReminder return @reminder end |
#getRepeat ⇒ Object
-
Get the reminder repeat for the event.
Returns
-
event reminder repeat.
149 150 151 |
# File 'lib/projects/model/Event.rb', line 149 def getRepeat return @repeat end |
#getScheduledOn ⇒ Object
-
Get the event scheduled on.
Returns
-
Event scheduled time.
89 90 91 |
# File 'lib/projects/model/Event.rb', line 89 def getScheduledOn return @scheduledOn end |
#getScheduledOnLong ⇒ Object
-
Get the event scheduled on long.
Returns
-
Event scheduled on long.
109 110 111 |
# File 'lib/projects/model/Event.rb', line 109 def getScheduledOnLong return @scheduledOnLong end |
#getTilte ⇒ Object
-
Get the event title.
Returns
-
Event title.
49 50 51 |
# File 'lib/projects/model/Event.rb', line 49 def getTilte return @title end |
#setAMPM(ampm) ⇒ Object
-
Set AM or PM for the event.
Parameters
- ampm
-
Event scheduled on AM or PM.
-
319 320 321 |
# File 'lib/projects/model/Event.rb', line 319 def setAMPM(ampm) @ampm = ampm end |
#setDurationHours(durationHour) ⇒ Object
-
Set the duration hour.
Parameters
- durationHour
-
Duration of the event in hours.
-
199 200 201 |
# File 'lib/projects/model/Event.rb', line 199 def setDurationHours(durationHour) @durationHour = durationHour end |
#setDurationMinutes(durationMinutes) ⇒ Object
-
Set the duration minutes for the event.
Parameters
- durationMinutes
-
Duration of the event in minutes.
-
219 220 221 |
# File 'lib/projects/model/Event.rb', line 219 def setDurationMinutes(durationMinutes) @durationMinutes = durationMinutes end |
#setHour(hour) ⇒ Object
-
Set the hour for the event.
Parameters
- hour
-
Hour for the event.
-
279 280 281 |
# File 'lib/projects/model/Event.rb', line 279 def setHour(hour) @hour = hour end |
#setId(id) ⇒ Object
-
Set the event id.
Parameters
- id
-
ID of the event.
-
19 20 21 |
# File 'lib/projects/model/Event.rb', line 19 def setId(id) @id = id end |
#setIsOpen(isOpen) ⇒ Object
-
Set the event is open or not.
Parameters
- isOpen
-
The event is open or not.
-
239 240 241 |
# File 'lib/projects/model/Event.rb', line 239 def setIsOpen(isOpen) @isOpen = isOpen end |
#setLocation(location) ⇒ Object
-
Set the event location.
Parameters
- location
-
Location of the event.
-
59 60 61 |
# File 'lib/projects/model/Event.rb', line 59 def setLocation(location) @location = location end |
#setMinutes(minutes) ⇒ Object
-
Set the minutes for the event.
Parameters
- minutes
-
Minutes for the event.
-
299 300 301 |
# File 'lib/projects/model/Event.rb', line 299 def setMinutes(minutes) @minutes = minutes end |
#setOccurred(occurred) ⇒ Object
-
Set no of times occurred for the reminder.
Parameters
- occurred
-
Number of times reminder has occurred.
-
179 180 181 |
# File 'lib/projects/model/Event.rb', line 179 def setOccurred(occurred) @occurred = occurred end |
#setOccurrences(occurrences) ⇒ Object
-
Set the occurrences for the reminder.
Parameters
- occurrences
-
Numnber of occurrences for the reminder.
-
159 160 161 |
# File 'lib/projects/model/Event.rb', line 159 def setOccurrences(occurrences) @occurrences = occurrences end |
#setParticipants(participants) ⇒ Object
-
Set the participants.
Parameters
- participants
-
List of Participant object.
-
259 260 261 |
# File 'lib/projects/model/Event.rb', line 259 def setParticipants(participants) @participants = participants end |
#setReminder(reminder) ⇒ Object
-
Set the reminder for the event.
Parameters
- reminder
-
Reminder for the event.
-
119 120 121 |
# File 'lib/projects/model/Event.rb', line 119 def setReminder(reminder) @reminder = reminder end |
#setRepeat(repeat) ⇒ Object
-
Set the reminder repeat for the event.
Parameters
- repeat
-
Repeat reminder for the event.
-
139 140 141 |
# File 'lib/projects/model/Event.rb', line 139 def setRepeat(repeat) @repeat = repeat end |
#setScheduledOn(scheduledOn) ⇒ Object
-
Set the event scheduled on.
Parameters
- scheduledOn
-
Scheduled time of the event.
-
79 80 81 |
# File 'lib/projects/model/Event.rb', line 79 def setScheduledOn(scheduledOn) @scheduledOn = scheduledOn end |
#setScheduledOnLong(scheduledOnLong) ⇒ Object
-
Set the event scheduled on long.
Parameters
- scheduledOnLong
-
Event scheduled on long.
-
99 100 101 |
# File 'lib/projects/model/Event.rb', line 99 def setScheduledOnLong(scheduledOnLong) @scheduledOnLong = scheduledOnLong end |
#setTitle(title) ⇒ Object
-
Set the event title.
Parameters
- title
-
Title of the event.
-
39 40 41 |
# File 'lib/projects/model/Event.rb', line 39 def setTitle(title) @title = title end |
#toParamMAP ⇒ Object
-
Convert the Event object into HashMap.
Returns
-
HashMap object.
339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
# File 'lib/projects/model/Event.rb', line 339 def toParamMAP requestBody = Hash.new if title != nil requestBody["title"] = title end if scheduledOn != nil requestBody["date"] = scheduledOn end if hour != nil requestBody["hour"] = hour end if minutes != nil requestBody["minutes"] = minutes end if ampm != nil requestBody["ampm"] = ampm end if durationHour != nil requestBody["duration_hour"] = durationHour end if durationMinutes != nil requestBody["duration_mins"] = durationMinutes end if participants != nil participantIds = "" participants.each do|participant| participantIds += String(participant.getParticipantId)+","; end requestBody["participants"] = participantIds end if reminder != nil requestBody["remind_before"] = reminder end if repeat != nil requestBody["repeat"] = repeat end if occurrences != nil && occurrences.to_i > 1 requestBody["nooftimes_repeat"] = occurrences end if location != nil requestBody["location"] = location end return requestBody end |