private Method

BaseModel.date_writer(name, type, disp_name=name)

There's no documentation for this item.

Source Code

# File rss/rss.rb, line 276
def date_writer(name, type, disp_name=name)
  module_eval("def \#{name}=(new_value)\nif new_value.nil? or new_value.kind_of?(Time)\n@\#{name} = new_value\nelse\nif @do_validate\nbegin\n@\#{name} = Time.__send__('\#{type}', new_value)\nrescue ArgumentError\nraise NotAvailableValueError.new('\#{disp_name}', new_value)\nend\nelse\n@\#{name} = nil\nif /\\\\A\\\\s*\\\\z/ !~ new_value.to_s\nbegin\n@\#{name} = Time.parse(new_value)\nrescue ArgumentError\nend\nend\nend\nend\n\n# Is it need?\nif @\#{name}\nclass << @\#{name}\nundef_method(:to_s)\nalias_method(:to_s, :\#{type})\nend\nend\n\nend\n", *get_file_and_line_from_caller(2))
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.