On 6 December 2016 at 17:12, Nathan Guilty <ruby / e-solutions.re> wrote:

> Hi,
>
> I need to store datas in a file, with add, remove, rotation (3 records
> max) features.
> The datas are username, and the score number.
>
> I heard about YAML. I looked here : https://ruby-doc.org/stdlib-1.
> 9.3/libdoc/yaml/rdoc/YAML.html
> But not too documented.
>
> Does someone can explain me how it works ?
> How i can implement that ?
>
> Thank you very much.
>
> Regards,
>
> /Nathan
>
>
Like it says on the tin: you put a string into
YAML.load
and you get a data structure out; you put a data structure into
YAML.dump
and you get a string out.

If you combine that with
File.open <https://ruby-doc.org/core-2.3.0/File.html#method-c-open>
 the world is your mollusc.

Cheers
-- 
  Matthew Kerwin
  http://matthew.kerwin.net.au/
(supressed text/html)
Unsubscribe: <mailto:ruby-talk-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>