Module: Messaged
- Defined in:
- lib/messaged.rb,
lib/messaged/engine.rb,
lib/messaged/version.rb,
app/models/messaged/room.rb,
app/models/messaged/message.rb,
lib/messaged/base_migration.rb,
app/models/messaged/null_user.rb,
app/models/messaged/null_tenant.rb,
app/jobs/messaged/application_job.rb,
app/models/messaged/user_extender.rb,
app/models/messaged/application_record.rb,
app/controllers/messaged/rooms_controller.rb,
app/controllers/messaged/messages_controller.rb,
lib/generators/messaged/views/views_generator.rb,
app/controllers/messaged/application_controller.rb,
lib/generators/messaged/install/install_generator.rb
Defined Under Namespace
Modules: Generators, UserExtender Classes: ApplicationController, ApplicationJob, ApplicationRecord, BaseMigration, Engine, Message, MessagesController, NullTenant, NullUser, Room, RoomsController
Constant Summary collapse
- VERSION =
"0.2.8"
Class Attribute Summary collapse
-
.current_tenant_method ⇒ Symbol
The name of the method used by Messaged controllers and views to get the currently signed-in tenant.
-
.current_user_method ⇒ Symbol
The name of the method used by Messaged controllers and views to get the currently signed-in user.
-
.tenant_class_name ⇒ String
readonly
The name of the tenant class.
-
.user_class_name ⇒ String
readonly
The name of the user class.
Class Method Summary collapse
-
.tenant_class ⇒ Class<Messaged::TenantExtender>
The tenant class from the host application.
- .tenant_class=(tenant_class_name) ⇒ Object
-
.user_class ⇒ Class<Messaged::UserExtender>
The user class from the host application.
- .user_class=(user_class_name) ⇒ Object
Class Attribute Details
.current_tenant_method ⇒ Symbol
Returns The name of the method used by Messaged controllers and views to get the currently signed-in tenant.
16 17 18 |
# File 'lib/messaged.rb', line 16 def current_tenant_method @current_tenant_method end |
.current_user_method ⇒ Symbol
Returns The name of the method used by Messaged controllers and views to get the currently signed-in user.
13 14 15 |
# File 'lib/messaged.rb', line 13 def current_user_method @current_user_method end |
.tenant_class_name ⇒ String (readonly)
Returns The name of the tenant class.
10 11 12 |
# File 'lib/messaged.rb', line 10 def tenant_class_name @tenant_class_name end |
.user_class_name ⇒ String (readonly)
Returns The name of the user class.
7 8 9 |
# File 'lib/messaged.rb', line 7 def user_class_name @user_class_name end |
Class Method Details
.tenant_class ⇒ Class<Messaged::TenantExtender>
Returns the tenant class from the host application.
44 45 46 47 48 |
# File 'lib/messaged.rb', line 44 def tenant_class # This is nil before the initializer is installed. return nil if @tenant_class_name.nil? @tenant_class_name.constantize end |
.tenant_class=(tenant_class_name) ⇒ Object
35 36 37 38 39 40 41 |
# File 'lib/messaged.rb', line 35 def tenant_class=(tenant_class_name) return nil if tenant_class_name.nil? unless tenant_class_name.is_a?(String) fail "Messaged.tenant_class must be set to a String, got #{tenant_class_name.inspect}" end @tenant_class_name = tenant_class_name end |
.user_class ⇒ Class<Messaged::UserExtender>
Returns the user class from the host application.
28 29 30 31 32 |
# File 'lib/messaged.rb', line 28 def user_class # This is nil before the initializer is installed. return nil if @user_class_name.nil? @user_class_name.constantize end |
.user_class=(user_class_name) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/messaged.rb', line 19 def user_class=(user_class_name) return nil if user_class_name.nil? unless user_class_name.is_a?(String) fail "Messaged.user_class must be set to a String, got #{user_class_name.inspect}" end @user_class_name = user_class_name end |