Module: ScrapCbf::Printable
- Included in:
- ScrapCbf, Championship, MatchesBuilder, MatchesPerRoundBuilder, RankingsBuilder, RoundsBuilder, TeamsBuilder
- Defined in:
- lib/scrap_cbf/printable.rb
Overview
Outputs data to stdout through kernel#puts. Useful for debugging entities.
Instance Method Summary collapse
-
#print(pretty = true) ⇒ Nil
Outputs data in JSON format.
Instance Method Details
#print(pretty = true) ⇒ Nil
Outputs data in JSON format
11 12 13 14 15 16 17 |
# File 'lib/scrap_cbf/printable.rb', line 11 def print(pretty = true) if pretty puts JSON.pretty_generate(to_h) else puts to_json end end |