Class: Panda::CMS::Admin::UserDisplayComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- Panda::CMS::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.
9 10 11 12 13 14 15 16 17 |
# File 'app/components/panda/cms/admin/user_display_component.rb', line 9 def initialize(user_id: nil, user: nil, metadata: "") @user = if user.nil? && user_id.present? && Panda::Core::User.find(user_id) Panda::Core::User.find(user_id) else user end @metadata = end |
Instance Attribute Details
#metadata ⇒ Object
Returns the value of attribute metadata.
7 8 9 |
# File 'app/components/panda/cms/admin/user_display_component.rb', line 7 def @metadata end |
#user ⇒ Object
Returns the value of attribute user.
7 8 9 |
# File 'app/components/panda/cms/admin/user_display_component.rb', line 7 def user @user end |
#user_id ⇒ Object
Returns the value of attribute user_id.
7 8 9 |
# File 'app/components/panda/cms/admin/user_display_component.rb', line 7 def user_id @user_id end |