Class: PandaCms::Admin::UserDisplayComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- PandaCms::Admin::UserDisplayComponent
- Defined in:
- app/components/panda_cms/admin/user_display_component.rb
Instance Attribute Summary collapse
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#user ⇒ Object
Returns the value of attribute user.
-
#user_id ⇒ Object
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(user_id: nil, user: nil, metadata: "") ⇒ UserDisplayComponent
constructor
A new instance of UserDisplayComponent.
Constructor Details
#initialize(user_id: nil, user: nil, metadata: "") ⇒ UserDisplayComponent
Returns a new instance of UserDisplayComponent.
8 9 10 11 12 13 14 15 16 |
# File 'app/components/panda_cms/admin/user_display_component.rb', line 8 def initialize(user_id: nil, user: nil, metadata: "") @user = if user.nil? && user_id.present? && PandaCms::User.find(user_id) PandaCms::User.find(user_id) else user end @metadata = end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
6 7 8 |
# File 'app/components/panda_cms/admin/user_display_component.rb', line 6 def @metadata end |
#user ⇒ Object
Returns the value of attribute user.
6 7 8 |
# File 'app/components/panda_cms/admin/user_display_component.rb', line 6 def user @user end |
#user_id ⇒ Object
Returns the value of attribute user_id.
6 7 8 |
# File 'app/components/panda_cms/admin/user_display_component.rb', line 6 def user_id @user_id end |