Class: Fragmentary::UserWidget

Inherits:
Widget
  • Object
show all
Defined in:
lib/fragmentary/widget.rb

Instance Attribute Summary collapse

Attributes inherited from Widget

#match, #template

Instance Method Summary collapse

Methods inherited from Widget

inherited, #pattern, subclasses

Constructor Details

#initialize(template, key) ⇒ UserWidget

Returns a new instance of UserWidget.



43
44
45
46
# File 'lib/fragmentary/widget.rb', line 43

def initialize(template, key)
  super
  @current_user = Fragmentary::Template.new(template).current_user
end

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.



41
42
43
# File 'lib/fragmentary/widget.rb', line 41

def current_user
  @current_user
end

Instance Method Details

#_contentObject



48
49
50
# File 'lib/fragmentary/widget.rb', line 48

def _content
  match ? user_content : nil
end