Class: Stratify::GitHub::Presenter

Inherits:
Object
  • Object
show all
Includes:
ActionView::Helpers::UrlHelper
Defined in:
lib/stratify-github/presenter.rb

Instance Method Summary collapse

Constructor Details

#initialize(activity) ⇒ Presenter

Returns a new instance of Presenter.



9
10
11
# File 'lib/stratify-github/presenter.rb', line 9

def initialize(activity)
  @activity = activity
end

Instance Method Details

#textObject



13
14
15
16
# File 'lib/stratify-github/presenter.rb', line 13

def text
  clazz = Stratify::GitHub::Event.const_get(@activity.event_type)
  return clazz.text(@activity)
end

#to_htmlObject



18
19
20
# File 'lib/stratify-github/presenter.rb', line 18

def to_html
  linkify_urls(text)
end