"icalendar.publish" 方法有什么作用?

What does "icalendar.publish" method do?

在 icalendar gem 的自述文件中,他们有这个示例代码:

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

cal.publish

cal.publish 方法有什么作用?没有它的文档,源代码只显示了这个:

def publish
  self.ip_method = 'PUBLISH'
end

这没用——ip_method 有什么用??

如果有人能解释一下,那将是一个很大的帮助。

从 Github 我可以看到有一个 optional_single_property(钩子?)定义。

https://github.com/icalendar/icalendar/blob/97ed9d301448350de15da4ba3b2323bd685d358c/lib/icalendar/has_properties.rb#L116

我认为这是指 iTip 方法,此方法只是设置发布方法。

我找到了这个 here:

The ‘methods’ are not explained in the iCalendar standard, but in the iTIP standard, and reading of this second standard clarified a lot. These are the supported methods as listed on page 8 of the standard:

PUBLISH: Used to publish an iCalendar object to one or more “Calendar Users”. There is no interactivity between the publisher and any other “Calendar User”. An example might include a baseball team publishing its schedule to the public.

iTip 内容在 RFC 5546 中有解释。

环顾四周,我发现另一个人说:

"iCalendar 使用了 PUBLISH 方法而不是 REQUEST。使用 REQUEST,它只是调出日历,而使用 PUBLISH 导入它。"

我希望这能回答你的问题。