EloquentRuby
This is the example gem from the book Eloquent Ruby, 2nd Edition. It includes a simple version of the Document class.
You can find all of the source code for the examples from the book here.
Installation
You can install the eloquent_ruby gem in the usual way, with either
the gem command or bundler.
Usage
Since the Document class is deliberately simple, there is not
much to using it. One difference between this gem and the code in
the book is that, following good gem practice, the Document class
is wrapped inside of the EloquentRuby module.
require "eloquent_ruby"
doc = EloquentRuby::Document.new(
title: "Hamlet",
author: "Shakespeare",
content: "To be or..."
)
puts doc.title
puts doc.author
puts doc.content
Contributing
Please report problems with this gem through the Pragmatic Press website.
License
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Document project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.he gem is available as open source under the terms of the MIT License.