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.3.6 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.5 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.4 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.3 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.2 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.1 lib/event_statuses.rb
radiant-event_calendar-extension-1.3.0 lib/event_statuses.rb
radiant-event_calendar-extension-1.1.2 lib/event_statuses.rb
radiant-event_calendar-extension-1.1.1 lib/event_statuses.rb
radiant-event_calendar-extension-1.1.0 lib/event_statuses.rb
radiant-event_calendar-extension-1.0.2 lib/event_statuses.rb
radiant-event_calendar-extension-1.0.1 lib/event_statuses.rb
radiant-event_calendar-extension-1.0.0 lib/event_statuses.rb