Sha256: c4490eaeecdaf00aacb95f6584ec1c20c14d6c3ac86c308cc228e5b7a07843ed

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 Bytes

Contents

module UserPresenter
  def full_name
    "#{first_name} #{last_name}"
  end
  def link
    link_to full_name, user_path(self)
  end

  module ClassMethods
    def full_names
      all.map(&:full_name).join(", ")
    end
  end
end
module QueenPresenter
  def link
    link_to "parent"
  end
end

module PrincePresenter
  def link
    link_to "child"
  end
end

module GamePresenter
  def free?
    name == "Team Fortress 2"
  end
end

module TreePresenter
  def url
    tree_url(self)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
easy_presenter-1.1.1 spec/fake_app/app/presenters.rb
easy_presenter-1.1.0 spec/fake_app/app/presenters.rb