validtion for non active record classes

Hi

      Can I use the active record validation for non active record
classes.
I have a class

class ServiceDeskResolutionEffort
  attr_reader :days
  attr_reader :hours
  attr_reader :minutes

  def initialize(data)
    @passed_effort= data.split(':').collect! {|n| n}
    @days = @passed_effort[0]
    @hours = @passed_effort[1]
    @minutes = @passed_effort[2]
  end

end

In the view

<td><table><tr>
    <th width=""><label for="" >Day: </label></th>
    <td><%= text_field :sd_resol, "days", "size" => 2 %></td>
    <th width=""><label for="" >Hr: </label></th>
    <td><%= text_field :sd_resol, "hours", "size" => 2 %></td>
    <th width=""><label for="" >Min: </label></th>
    <td><%= text_field :sd_resol, "minutes", "size" => 2 %></td>

In controller
#for exampleday:hour:min
@sd_resol = ServiceDeskResolutionEffort.new("1:22:10")

Here HOW CAN I IMPLEMENT VALIDATION THAT HOUR NOT GREATER THAN 23 AND
MINUTE NOT GREATER HAN 59 AND ALSO CHECK NON NUMERIC CHARACTERS NOT TO
BE ENTERED ALL THESE DAY:HOUR:MINUTE

Sijo

Hey,
Please find the code as follows.

class ServiceDeskResolutionEffort
attr_reader :seconds
attr_reader :hours
attr_reader :minutes

def initialize(data)
begin
@passed_effort= data.split(’:’).collect! {|n| n}
hours = @passed_effort[0]
minutes = @passed_effort[1]
seconds = @passed_effort[2]
if /^(\d)(\d?)$/.match(hours) == nil || /^(\d)(\d)$/.match(minutes) == nil || /^(\d)(\d)$/.match(seconds) == nil
raise “Please enter the numeric value in time.”
elsif hours.to_i > 23 || minutes.to_i > 59 || seconds.to_i > 59
raise “Please enter the right rage of values.”
else
@hours = hours
@minutes = minutes
@seconds = seconds
end
rescue
puts $!
end
end

end

ServiceDeskResolutionEffort.new(“1:22:10”)

Sorry sir A change is there i need the vallidation when i save ..My
controller as

def sd_resolution_save
      @sd_effort=params[:sd_resol][:days]+':'+params[:sd_resol][:hours]+':'+params[:sd_resol][:minutes]
@sd_resolution_id=params[:sd_resolution_id]
   if @sd_resolution_id==nil
  @service_desk_resolution=ServiceDeskResolution.new(params[:sd_resolution])
  @service_desk_resolution.effort=@sd_effort
  @service_desk_resolution.save
   else
  @sd_ticket_resolution=ServiceDeskResolution.find @sd_resolution_id
  @sd_ticket_resolution.update_attribute(:effort,@sd_effort)
      @update_sd_ticket_resolution=@sd_ticket_resolution.update_attributes(params[:sd_resolution])
  end
        redirect_to :action => 'show_details', :id => params[:id]
end

HERE BEFORE SAVING @service_desk_resolution.effort I NEED
VALIDATION..ALL THE OTHER SAME AS MY PROBLEM..AND PLEASE TELL ME HOW TO
CAPTURE THAT ERROR(IF EXISTS ALSO..Here ServiceDeskResolution is an
active record class

Sijo