Module: ActsAsFullCalendarEvent::CalendarEvent

Extended by:
ActiveSupport::Concern
Defined in:
lib/acts_as_full_calendar_event/calendar_event.rb

Instance Method Summary collapse

Instance Method Details

#acts_as_full_calendar_event(args = {}) ⇒ Object



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 38

def acts_as_full_calendar_event(args = {})
  calendar_class_args = i[
    method_fields
    method_filter_category
    method_filter_user
    method_filter_date
    method_categories
    field_category_class
  ].freeze

  define_method :acts_as_full_calendar_event_options do
    self.class.instance_variable_get("@acts_as_full_calendar_event_options")
  end

  class_eval do
    @acts_as_full_calendar_event_options = { }.merge(args)

    def self.calendar_event?
      true
    end
  end

  class_args = args.select { |key, value| calendar_class_args.include?(key) }
  self.acts_as_full_calendar_event_options = { }.merge(class_args)
end

#calendar_item_colorObject



80
81
82
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 80

def calendar_item_color
  self.public_send(acts_as_full_calendar_event_options[:field_color])
end

#calendar_item_descriptionObject



76
77
78
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 76

def calendar_item_description
  self.public_send(acts_as_full_calendar_event_options[:field_description])
end

#calendar_item_end_atObject



68
69
70
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 68

def calendar_item_end_at
  self.public_send(acts_as_full_calendar_event_options[:field_end])
end


96
97
98
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 96

def calendar_item_link_data_target
  self.public_send(acts_as_full_calendar_event_options[:field_link_data_target])
end


92
93
94
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 92

def calendar_item_link_data_toggle
  self.public_send(acts_as_full_calendar_event_options[:field_link_data_toggle])
end

#calendar_item_start_atObject



64
65
66
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 64

def calendar_item_start_at
  self.public_send(acts_as_full_calendar_event_options[:field_start])
end

#calendar_item_text_colorObject



84
85
86
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 84

def calendar_item_text_color
  self.public_send(acts_as_full_calendar_event_options[:field_text_color])
end

#calendar_item_titleObject



72
73
74
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 72

def calendar_item_title
  self.public_send(acts_as_full_calendar_event_options[:field_title])
end

#calendar_item_urlObject



88
89
90
# File 'lib/acts_as_full_calendar_event/calendar_event.rb', line 88

def calendar_item_url
  self.public_send(acts_as_full_calendar_event_options[:field_url])
end