Class: Event

Inherits:
Component show all
Defined in:
lib/app/models/event.rb

Instance Attribute Summary

Attributes inherited from Component

#component

Instance Method Summary collapse

Methods inherited from Component

#add_component, base_class, #belongs_to, class_of_active_record_descendant, #component_names, #components, compute_table_name, #reset_component, reset_table_name, #set_component, table_name, #to_ical, #trigger_parent_component

Instance Method Details

#add_exdate_with_unsafe(args) ⇒ Object



35
36
37
38
39
# File 'lib/app/models/event.rb', line 35

def add_exdate_with_unsafe(args)
  _exdate = Patterns::ExDate.new(:rule => add_exdate_without_unsafe(args))
  self.ex_dates << _exdate
  map_exdates
end

#add_exrule_with_unsafe(repeats, args = {}) ⇒ Object



19
20
21
22
23
# File 'lib/app/models/event.rb', line 19

def add_exrule_with_unsafe(repeats, args ={})
  _exrule = Patterns::ExRule.new(:rule => add_rule(repeats, args))
  self.ex_rules << _exrule
  map_exrules
end

#add_rdate_with_unsafe(args) ⇒ Object



27
28
29
30
31
# File 'lib/app/models/event.rb', line 27

def add_rdate_with_unsafe(args)
  _rdate = Patterns::RDate.new(:rule => add_rdate_without_unsafe(args))
  self.r_dates << _rdate
  map_rdates
end

#add_rrule_with_unsafe(repeats, args = {}) ⇒ Object



12
13
14
15
16
# File 'lib/app/models/event.rb', line 12

def add_rrule_with_unsafe(repeats, args ={})
  _rrule = Patterns::RRule.new(:rule => add_rule(repeats, args))
  self.r_rules << _rrule
  map_rrules
end

#map_exdatesObject



54
55
56
# File 'lib/app/models/event.rb', line 54

def map_exdates
  self.component.exdates= self.ex_dates.map {|exd| exd.rule }
end

#map_exrulesObject



46
47
48
# File 'lib/app/models/event.rb', line 46

def map_exrules
  self.component.exrules= self.ex_rules.map {|ex| ex.rule }
end

#map_rdatesObject



50
51
52
# File 'lib/app/models/event.rb', line 50

def map_rdates
  self.component.rdates= self.r_dates.map {|rd| rd.rule }
end

#map_rrulesObject



42
43
44
# File 'lib/app/models/event.rb', line 42

def map_rrules
  self.component.rrules= self.r_rules.map {|rr| rr.rule }
end