Sha256: 4d84ed9808d3ba198b30cbec43b8e25ab5a4a04ddb518401125aca4344677cfc

Contents?: true

Size: 457 Bytes

Versions: 33

Compression:

Stored size: 457 Bytes

Contents

module EventStatuses
  def self.included(base)
    base.class_eval {
      cattr_accessor :statuses
      extend ClassMethods
      include InstanceMethods
    }
    
    base.add_status(:id => 5, :name => 'Submitted')
    base.add_status(:id => 200, :name => 'Imported')
  end
  
  module ClassMethods
    def add_status(properties)
      statuses.push(Status.new(properties))
    end
  end

  module InstanceMethods
    def to_s
      id
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
radiant-event_calendar-extension-1.5.6 lib/event_statuses.rb
radiant-event_calendar-extension-1.5.5 lib/event_statuses.rb
radiant-event_calendar-extension-1.5.4 lib/event_statuses.rb
radiant-event_calendar-extension-1.5.3 lib/event_statuses.rb
radiant-event_calendar-extension-1.5.1 lib/event_statuses.rb
radiant-event_calendar-extension-1.5.0 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.14 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.12 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.10 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.9 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.8 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.7 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.6 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.5 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.2 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.1 lib/event_statuses.rb
radiant-event_calendar-extension-1.4.0 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.9 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.8 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.7 lib/event_statuses.rb