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