# ----------------------------------------------------------------------- # Copyright © 2012 ShepHertz Technologies Pvt Ltd. All rights reserved. # ----------------------------------------------------------------------- require 'App42Response.rb' # # # This User object is the value object which contains the properties of User # along with the setter & getter for those properties. # # module App42 module User class User < App42Response attr_accessor :userName, :password,:email, :profile, :accountLocked, :roleList @userName @password @email @profile @roleList = Array.new() @accountLocked = false # # Returns the User Response in JSON format. # # @return the response in JSON format. # # def to_s return strResponse end # # An enum that contains the User Gender either MALE or FEMALE. # # class UserGender unless (const_defined?(:MALE)) MALE ="Male" end unless (const_defined?(:FEMALE)) FEMALE = "Female" end # # Sets the value of the UserGender. MALE or FEMALE. # # @param value # - the value of UserGender either MALE or FEMALE. # def enum(string) return UserGender.const_get(string) end # # Returns the value of the UserGender. MALE or FEMALE. # # @return the value of UserGender. # # def isAvailable(string) if(string == "Male") return "Male" elsif(string == "Female") return "Female"; else return nil end end end end class Profile attr_accessor :firstName, :lastName,:mobile,:line1,:line2,:city,:state,:country,:pincode,:homeLandLine,:officeLandLine,:sex,:dateOfBirth @firstName @lastName @mobile @line1 @line2 @city @state @country @pincode @homeLandLine @officeLandLine @sex @dateOfBirth # # This is a constructor that takes no parameter # def initialize(user) user.profile = (self) end end end end