Sha256: e106faa7a36a238a16bfe788ee8b04e5d83954ac2f4307c77f05d35aab81abb4

Contents?: true

Size: 795 Bytes

Versions: 1

Compression:

Stored size: 795 Bytes

Contents

# encoding: UTF-8


class Spontaneous::Site
  module Features
    extend Spontaneous::Concern

    # InstanceMethods
    def back_controllers
      @back_controllers ||= []
    end

    def front_controllers
      @front_controllers ||= []
    end

    def register_back_controller(namespace, controller_class)
      Spontaneous::Rack.make_back_controller(controller_class)
      controller_class.requires_authentication!
      back_controllers << [namespace_url(namespace), controller_class]
    end

    def register_front_controller(namespace, controller_class)
      Spontaneous::Rack.make_front_controller(controller_class)
      front_controllers << [namespace_url(namespace), controller_class]
    end

    def namespace_url(namespace)
      "/@#{namespace}"
    end
  end # Features
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spontaneous-0.2.0.beta1 lib/spontaneous/site/features.rb