I had a case where my screens were taking really long time to load to the collection of data from database, which was expected by business. It was really unbearable for UI development, so I decided to mock out this model for development so I could concentrate on development and not loose time for getting data, since I knew it was correct.
A while ago I shamble upon this post by errtheblog who explained how to use Struct
So here we go:
I have a model called region_agreement which has a method find_report_generation_progress_by_date which I wanted to mock out.
RegionAgreementFirst = Struct.new(:region_name,:end_time,:start_time,:num_expected,:num_ready,:region_id)
class RegionAgreement < ActiveRecord::Base
...
def self.find_report_generation_progress_by_date(date=nil)
RegionAgreementFirst.new("BLACKROCK",'Wed Jun 27 09:03:28 -0400 2007',
'Wed Jun 27 08:56:29 -0400 2007',118.0,119.0,1)
Also, you may check out How To Get Data From Console And Splat It in To Struct