diff options
author | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-11-04 19:23:17 +0100 |
---|---|---|
committer | Lars Henrik Mai <lars.mai@kontinui.de> | 2014-11-04 19:23:17 +0100 |
commit | 3562a4142ad8a8f8b2b3a1a10538acfbf146d462 (patch) | |
tree | 5ab83f649b0b94b817753b245aa702c77cc15ef9 /helpers/projects_helpers.rb | |
parent | 837f41d664c5e092bf946a1d1d81bdf7f136f2ef (diff) |
add helpers for project infos
Diffstat (limited to 'helpers/projects_helpers.rb')
-rw-r--r-- | helpers/projects_helpers.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/helpers/projects_helpers.rb b/helpers/projects_helpers.rb new file mode 100644 index 0000000..3007b17 --- /dev/null +++ b/helpers/projects_helpers.rb @@ -0,0 +1,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 |