Sha256: 48fca420da116e3c5a856e3538018cebe1bc682fb26f60109a2a454eaea679f9

Contents?: true

Size: 344 Bytes

Versions: 11

Compression:

Stored size: 344 Bytes

Contents

module SimpleCalendar
  module ModelAdditions
    def has_calendar(options={})
      config = { :attribute => :starts_at }

      # Override default config
      config.update(options) if options.is_a?(Hash)

      class_eval <<-EOV
        def simple_calendar_start_time
          #{config[:attribute]}
        end
      EOV
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
simple_calendar-1.1.10 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.9 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.8 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.7 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.6 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.5 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.4 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.3 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.2 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.1 lib/simple_calendar/model_additions.rb
simple_calendar-1.1.0 lib/simple_calendar/model_additions.rb