Class: PostRunner::UserProfileView

Inherits:
Object
  • Object
show all
Includes:
ViewWidgets
Defined in:
lib/postrunner/UserProfileView.rb

Instance Method Summary collapse

Methods included from ViewWidgets

#button, #footer, #frame, #titlebar, #view_widgets_style

Constructor Details

#initialize(fit_activity, unit_system) ⇒ UserProfileView

Returns a new instance of UserProfileView.



23
24
25
26
# File 'lib/postrunner/UserProfileView.rb', line 23

def initialize(fit_activity, unit_system)
  @fit_activity = fit_activity
  @unit_system = unit_system
end

Instance Method Details

#to_html(doc) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/postrunner/UserProfileView.rb', line 28

def to_html(doc)
  return nil if @fit_activity.user_profiles.empty?

  frame(doc, 'User Profile') {
    profile.to_html(doc)
  }
end

#to_sObject



36
37
38
39
# File 'lib/postrunner/UserProfileView.rb', line 36

def to_s
  return '' if @fit_activity.user_profiles.empty?
  profile.to_s
end