matthucke/graveyards4

View on GitHub
app/models/breadcrumb.rb

Summary

Maintainability
A
25 mins
Test Coverage
class Breadcrumb
  attr_accessor :url, :title

  def initialize(attrs={})
    attrs[:url].tap do |u|
      @url=u unless u.blank?
    end
    attrs[:title].tap do |t|
      @title=t unless t.blank?
    end
  end

  def self.new_from_request(request)
    b = Breadcrumb.new(:url => request.path, :title=>nil)
  end
end