Module: Cream

Defined in:
lib/cream/configure/engine.rb,
lib/cream/role.rb,
lib/cream/namespaces.rb,
lib/cream/rails/config.rb,
lib/cream/roles_config.rb,
lib/generators/cream/helpers/all.rb,
lib/cream/controller/user_control.rb,
lib/generators/cream/views/haml_util.rb,
lib/generators/cream/app/app_generator.rb,
lib/generators/cream/helpers/orm_helper.rb,
lib/generators/cream/helpers/args_helper.rb,
lib/generators/cream/views/views_generator.rb,
lib/generators/cream/helpers/execute_helper.rb,
lib/generators/cream/helpers/gemfile_helper.rb,
lib/generators/cream/helpers/strategy_helper.rb,
lib/generators/cream/full_config/full_config_generator.rb

Overview

Not yet used! Should use it?

Defined Under Namespace

Modules: Controller, GeneratorHelper, Generators, Helper, Rails, Role, UserControl, UserTypes, View Classes: Engine

Constant Summary collapse

@@roles =
[]
@@user_types =
[]

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.available_rolesObject

Returns the value of attribute available_roles.



3
4
5
# File 'lib/cream/role.rb', line 3

def available_roles
  @available_roles
end

.available_user_typesObject

Returns the value of attribute available_user_types.



4
5
6
# File 'lib/cream/role.rb', line 4

def available_user_types
  @available_user_types
end

Class Method Details

.include_helpers(scope) ⇒ Object

Include helpers in the given scope to AC and AV. “Borrowed” from devise



6
7
8
9
10
11
12
13
14
15
# File 'lib/cream/configure/engine.rb', line 6

def self.include_helpers(scope)
  ActiveSupport.on_load(:action_controller) do
    include scope::Helpers
    include scope::UrlHelpers
  end

  ActiveSupport.on_load(:action_view) do
    include scope::UrlHelpers
  end
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (Cream)

    the object that the method was called on



6
7
8
# File 'lib/cream/roles_config.rb', line 6

def self.setup
  yield self
end