summaryrefslogtreecommitdiff
path: root/helpers/projects_helpers.rb
blob: 3007b17fdda8f4831d7beedd79bd7d9137c5d012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
module ProjectsHelpers

  class Project

    attr_reader :name, :text, :link, :bild

    def initialize(atts={})
      @name = atts.fetch("name")
      @text = atts.fetch("text")
      @link = atts.fetch("link", nil)
      @bild = atts.fetch("bild", nil)
    end

  end

  def projects
    data.projects.map {|atts| Project.new(atts) }
  end

  def project_classes(project)
    [
      "large-6",
      "medium-6",
      "columns",
      ("end" if projects.last.name == project.name)
    ]
  end


end