diff options
Diffstat (limited to 'helpers')
-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 |