def module_definition_for(name_or_params)
      case name_or_params
      when String
        alchemy_modules.detect { |m| m['name'] == name_or_params }
      when Hash
        name_or_params.stringify_keys!
        alchemy_modules.detect do |alchemy_module|
          module_navi = alchemy_module.fetch('navigation', {})
          definition_from_mainnavi(module_navi, name_or_params) ||
            definition_from_subnavi(module_navi, name_or_params)
        end
      else
        raise ArgumentError, "Could not find module definition for #{name_or_params}"
      end
    end
def module_definition_for(name_or_params)
      case name_or_params
      when String
        alchemy_modules.detect { |m| m['name'] == name_or_params }
      when Hash
        name_or_params.stringify_keys!
        alchemy_modules.detect do |alchemy_module|
          module_navi = alchemy_module.fetch('navigation', {})
          definition_from_mainnavi(module_navi, name_or_params) ||
            definition_from_subnavi(module_navi, name_or_params)
        end
      else
        raise ArgumentError, "Could not find module definition for #{name_or_params}"
      end
    end
def module_definition_for ( name_or_params ) case name_or_params when String alchemy_modules . detect { | m | m [ 'name' ] == name_or_params } when Hash name_or_params . stringify_keys! alchemy_modules . detect do | alchemy_module | module_navi = alchemy_module . fetch ( 'navigation' , { } ) definition_from_mainnavi ( module_navi , name_or_params ) || definition_from_subnavi ( module_navi , name_or_params ) end else raise ArgumentError , "Could not find module definition for #{name_or_params}" end end
Get the module definition for given module name

 You can also pass a hash of an module definition.
 It then tries to find the module defintion from controller name and action name
Get the module definition for given module name