class Projects::Model::Event

Attributes

ampm[RW]
durationHour[RW]
durationMinutes[RW]
hour[RW]
id[RW]
isOpen[RW]
location[RW]
minutes[RW]
occurred[RW]
occurrences[RW]
participants[RW]
reminder[RW]
repeat[RW]
scheduledOn[RW]
scheduledOnLong[RW]
title[RW]

Public Instance Methods

getAMPM() click to toggle source
  • Get AM or PM for the event.

Returns

  • Time format of the event in AM or PM.

# File lib/projects/model/Event.rb, line 329
def getAMPM
        return @ampm
end
getDurationHours() click to toggle source
  • Get the duration hour for the event.

Returns

  • Event duration in hours.

# File lib/projects/model/Event.rb, line 209
def getDurationHours
        return @durationHour
end
getDurationMinutes() click to toggle source
  • Get the duration minutes for the event.

Returns

  • Event duration in minutes.

# File lib/projects/model/Event.rb, line 229
def getDurationMinutes
        return @durationMinutes
end
getHour() click to toggle source
  • Get the hour for the event.

Returns

# File lib/projects/model/Event.rb, line 289
def getHour
        return @hour
end
getId() click to toggle source
  • Get the event id.

Returns

# File lib/projects/model/Event.rb, line 29
def getId
        return @id
end
getLocation() click to toggle source
  • Get the event location.

Returns

# File lib/projects/model/Event.rb, line 69
def getLocation
        return @location
end
getMinutes() click to toggle source
  • Get the minutes for the event.

Returns

  • Minutes for the event.

# File lib/projects/model/Event.rb, line 309
def getMinutes
        return @minutes
end
getOccurred() click to toggle source
  • Get no of times occurred for the reminder.

Returns

  • No of times the reminder has occurred.

# File lib/projects/model/Event.rb, line 189
def getOccurred
        return @occurred
end
getOccurrences() click to toggle source
  • Get the occurrences for the reminder.

Returns

  • Number of occurences of the reminder.

# File lib/projects/model/Event.rb, line 169
def getOccurrences
        return @occurrences
end
getParticipants() click to toggle source
  • Get the participants.

Returns

# File lib/projects/model/Event.rb, line 269
def getParticipants
        return @participants
end
getReminder() click to toggle source
  • Get the reminder for the event.

Returns

  • event reminder.

# File lib/projects/model/Event.rb, line 129
def getReminder
        return @reminder
end
getRepeat() click to toggle source
  • Get the reminder repeat for the event.

Returns

  • event reminder repeat.

# File lib/projects/model/Event.rb, line 149
def getRepeat
        return @repeat
end
getScheduledOn() click to toggle source
  • Get the event scheduled on.

Returns

# File lib/projects/model/Event.rb, line 89
def getScheduledOn
        return @scheduledOn
end
getScheduledOnLong() click to toggle source
  • Get the event scheduled on long.

Returns

  • Event scheduled on long.

# File lib/projects/model/Event.rb, line 109
def getScheduledOnLong
        return @scheduledOnLong
end
getTilte() click to toggle source
  • Get the event title.

Returns

# File lib/projects/model/Event.rb, line 49
def getTilte
        return @title
end
setAMPM(ampm) click to toggle source
  • Set AM or PM for the event.

Parameters

  • ampm
    • Event scheduled on AM or PM.

# File lib/projects/model/Event.rb, line 319
def setAMPM(ampm)
        @ampm = ampm
end
setDurationHours(durationHour) click to toggle source
  • Set the duration hour.

Parameters

  • durationHour
    • Duration of the event in hours.

# File lib/projects/model/Event.rb, line 199
def setDurationHours(durationHour)
        @durationHour = durationHour
end
setDurationMinutes(durationMinutes) click to toggle source
  • Set the duration minutes for the event.

Parameters

  • durationMinutes
    • Duration of the event in minutes.

# File lib/projects/model/Event.rb, line 219
def setDurationMinutes(durationMinutes) 
        @durationMinutes = durationMinutes
end
setHour(hour) click to toggle source
  • Set the hour for the event.

Parameters

  • hour
    • Hour for the event.

# File lib/projects/model/Event.rb, line 279
def setHour(hour)
        @hour = hour
end
setId(id) click to toggle source
  • Set the event id.

Parameters

  • id
    • ID of the event.

# File lib/projects/model/Event.rb, line 19
def setId(id)
        @id = id
end
setIsOpen(isOpen) click to toggle source
  • Set the event is open or not.

Parameters

  • isOpen
    • The event is open or not.

# File lib/projects/model/Event.rb, line 239
def setIsOpen(isOpen)
        @isOpen = isOpen
end
setLocation(location) click to toggle source
  • Set the event location.

Parameters

  • location
    • Location of the event.

# File lib/projects/model/Event.rb, line 59
def setLocation(location)
        @location = location
end
setMinutes(minutes) click to toggle source
  • Set the minutes for the event.

Parameters

  • minutes
    • Minutes for the event.

# File lib/projects/model/Event.rb, line 299
def setMinutes(minutes)
        @minutes = minutes
end
setOccurred(occurred) click to toggle source
  • Set no of times occurred for the reminder.

Parameters

  • occurred
    • Number of times reminder has occurred.

# File lib/projects/model/Event.rb, line 179
def setOccurred(occurred)
        @occurred = occurred
end
setOccurrences(occurrences) click to toggle source
  • Set the occurrences for the reminder.

Parameters

  • occurrences
    • Numnber of occurrences for the reminder.

# File lib/projects/model/Event.rb, line 159
def setOccurrences(occurrences)
        @occurrences = occurrences
end
setParticipants(participants) click to toggle source
  • Set the participants.

Parameters

# File lib/projects/model/Event.rb, line 259
def setParticipants(participants)
        @participants = participants
end
setReminder(reminder) click to toggle source
  • Set the reminder for the event.

Parameters

  • reminder
    • Reminder for the event.

# File lib/projects/model/Event.rb, line 119
def setReminder(reminder)
        @reminder = reminder
end
setRepeat(repeat) click to toggle source
  • Set the reminder repeat for the event.

Parameters

  • repeat
    • Repeat reminder for the event.

# File lib/projects/model/Event.rb, line 139
def setRepeat(repeat)
        @repeat = repeat
end
setScheduledOn(scheduledOn) click to toggle source
  • Set the event scheduled on.

Parameters

  • scheduledOn
    • Scheduled time of the event.

# File lib/projects/model/Event.rb, line 79
def setScheduledOn(scheduledOn)
        @scheduledOn = scheduledOn
end
setScheduledOnLong(scheduledOnLong) click to toggle source
  • Set the event scheduled on long.

Parameters

  • scheduledOnLong
    • Event scheduled on long.

# File lib/projects/model/Event.rb, line 99
def setScheduledOnLong(scheduledOnLong)
        @scheduledOnLong = scheduledOnLong
end
setTitle(title) click to toggle source
  • Set the event title.

Parameters

  • title
    • Title of the event.

# File lib/projects/model/Event.rb, line 39
def setTitle(title)
        @title = title
end
toParamMAP() click to toggle source
  • Convert the Event object into HashMap.

Returns

  • HashMap object.

# 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