Sha256: 421e3734d4c9569ecbbc936eeb95f032c639e915fa23d5a3eeddd27829bfef89

Contents?: true

Size: 605 Bytes

Versions: 1

Compression:

Stored size: 605 Bytes

Contents

require_relative './Document'

class StrawberryDocument < Document

    attr_accessor :attributes

    def initialize(title:, attributes:)
        @title = title
        @attributes = attributes
    end

    def render
        result = ""
        result += @title
        result += "\n--------------------\n"
        @attributes.each do |key, value|
            result += key.to_s + " " + value.to_s + "\n"
        end
        result += generateDate
        puts result
        return result
    end

end

test = StrawberryDocument.new(title: 'elo', attributes: {size: '3 cm', weight: '1kg'})

test.render

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
strawberry_rafcio28s-0.1.0 lib/StrawberryDocument.rb