forked from apptrix/actic
-
Notifications
You must be signed in to change notification settings - Fork 1
/
README
52 lines (32 loc) · 1.39 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Actic
=====
Hi,
This is a very early beta, functionality is currently very limited.
This gem fuses iCalendar with ORM, can be used to make your data model date and event aware.
it can be used to create calendar objects and events at the moment,
more subcomponents will be added in time
Generators
=========
rails g actic_calendar ### will generate a calendar model and migration with the model name Calendar.
rails g actic_calendar NuCal owner:references ### you can supply a name and/or additional database fields
rails g actic_calendar owner:references ### you can supply additional fields and no name!
API Example
==========
Models implementing this interface will need to offer an 'ical' string field ( t.string :ical ) in the database schema. ( if you use the generators you wont need to worry about this )
class Event < ActiveRecord::Base
include Actic::Event
end
event = Event.new
event.start_time = DateTime.now
event.end_time = DateTime.now + 3.hours
event.recurrence = "FREQ=DAILY;COUNT=10"
# OR
event.recurs :freq => :daily, :count => 10
event.description = "Bake Cake"
event.occurrences(:after => DateTime.now, :before => (DateTime.now + 5.days))
class Calendar < ActiveRecord::Base
include Actic::Calendar
end
c = Calendar.new
c.add_subcomponent event
Copyright (c) 2010 Steve Martin, released under the MIT license