Sha256: a3b611ed3eb62a79711a15e84c5e5098f5929c28a0d74ddc879df594e3dd7115
Contents?: true
Size: 649 Bytes
Versions: 1
Compression:
Stored size: 649 Bytes
Contents
require_relative './Document' class WorkersDocument < Document attr_accessor :workers def initialize(title:, workers:) @title = title @workers = workers end def render result = "" result += @title.to_s + "\n" result += "-----------------\n" @workers.each do |worker| result += worker[:name].to_s + " " + worker[:surname].to_s + "\n" end result += generateDate puts result return result end end test = WorkersDocument.new(title: 'elo', workers: [{name: 'Adam', surname: 'Kowalski'}, {name: 'Alex', surname: 'Dębowski'}]) test.render
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
strawberry_rafcio28s-0.1.0 | lib/WorkersDocument.rb |