Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marshal.dump fails #78

Closed
sl1974 opened this issue Jul 22, 2014 · 1 comment
Closed

Marshal.dump fails #78

sl1974 opened this issue Jul 22, 2014 · 1 comment

Comments

@sl1974
Copy link

sl1974 commented Jul 22, 2014

Marshal.dump fails when applied to Calendar objects with error can't dump hash with default proc (TypeError).

Here is an example that fails with the mentioned error:

require 'icalendar'

# Create a calendar with an event (standard method)
cal = Icalendar::Calendar.new
cal.event do |e|
  e.dtstart     = Icalendar::Values::Date.new('20050428')
  e.dtend       = Icalendar::Values::Date.new('20050429')
  e.summary     = "Meeting with the man."
  e.description = "Have a long lunch meeting and decide nothing..."
  e.ip_class    = "PRIVATE"
end

Marshal.dump(cal)

Marshalling worked fine with v. 1.5.

@sl1974 sl1974 changed the title Marshalling doesn't work. Marshal.dump fails Jul 22, 2014
@rahearn
Copy link
Collaborator

rahearn commented Jul 23, 2014

We have no plans to support Marshal.dump on iCalendar objects.

As an alternative, you can just use cal.to_ical to get a string representation that can completely rebuild your object structure with Icalendar.parse (or the Icalendar::Parser class for more tricky cases)

@rahearn rahearn closed this as completed Jul 23, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants