0.0
The project is in a healthy, maintained state
This is the example gem from the book Eloquent Ruby, 2nd Edition." It includes a simple version of the Document class.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.5.1
 Project Readme

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.