Class: PandaCms::Admin::UserDisplayComponent

Inherits:
ViewComponent::Base
  • Object
show all
Defined in:
app/components/panda_cms/admin/user_display_component.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#metadataObject

Returns the value of attribute metadata.



6
7
8
# File 'app/components/panda_cms/admin/user_display_component.rb', line 6

def 
  @metadata
end

#userObject

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_idObject

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