Class: Artisan::Activity::ActivityPresenter
- Inherits:
-
Object
- Object
- Artisan::Activity::ActivityPresenter
- Defined in:
- lib/artisan/activity/activity_presenter.rb
Instance Attribute Summary collapse
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #changes ⇒ Object
-
#initialize(changes, project) ⇒ ActivityPresenter
constructor
A new instance of ActivityPresenter.
Constructor Details
#initialize(changes, project) ⇒ ActivityPresenter
Returns a new instance of ActivityPresenter.
11 12 13 14 |
# File 'lib/artisan/activity/activity_presenter.rb', line 11 def initialize(changes, project) @changes = changes @project = project end |
Instance Attribute Details
#project ⇒ Object (readonly)
Returns the value of attribute project.
9 10 11 |
# File 'lib/artisan/activity/activity_presenter.rb', line 9 def project @project end |
Instance Method Details
#changes ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/artisan/activity/activity_presenter.rb', line 16 def changes changes = [] @changes.each do |change| temporal = Formatters::Temporal.new(change) changes << { :date => temporal.date, :time => temporal.time, :who => Formatters::Name.new(change).full_name, :what => Formatters::Source.new(change).type, :diffs => Formatters::DiffChanges.new(change).diffs, :event => change.event } end return changes end |