class ResourceDecorator

TODO: Refactor into OperableDecorator module

Public Instance Methods

last_operation() click to toggle source
# File lib/aptible/rails/decorators/resource_decorator.rb, line 16
def last_operation
  return nil unless object.last_operation
  @last_operation ||= OperationDecorator.decorate(object.last_operation)
end
last_operation_gravatar() click to toggle source
# File lib/aptible/rails/decorators/resource_decorator.rb, line 3
def last_operation_gravatar
  garner.bind(h.controller.session_token).bind(object) do
    last_operation.creator_gravatar
  end
end
last_operation_summary() click to toggle source
# File lib/aptible/rails/decorators/resource_decorator.rb, line 9
def last_operation_summary
  garner.bind(h.controller.session_token).bind(object) do
    "#{last_operation.past_tense} " \
    "#{h.time_ago_in_words(last_operation.created_at)} ago"
  end
end
operation_count() click to toggle source
# File lib/aptible/rails/decorators/resource_decorator.rb, line 21
def operation_count
  garner.bind(h.controller.session_token).bind(object) do
    object.operations.count
  end
end