From b972df4334b46de073d112691b8e04ae7e4bb4fe Mon Sep 17 00:00:00 2001 From: Jessica Dillon & Jessica Lynn Suttles Date: Tue, 25 Feb 2014 15:11:42 -0800 Subject: [PATCH] Add a usage example for nested microformats to README Fixes #25 --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index c164c56..3a2463a 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,15 @@ collection = Microformats2.parse(source) collection.card.name.to_s #=> "Jessica Lynn Suttles" # using plural accessors collection.cards.first.names.first.to_s #=> "Jessica Lynn Suttles" + +source = '
+

Microformats 2

+

Jessica Lynn Suttles

+
' +collection = Microformats2.parse(source) +collection.entry.name.to_s #=> "Microformats 2" +# accessing nested microformats +collection.entry.author.format.name.to_s #=> "Jessica Lynn Suttles" ``` * `source` can be a URL, filepath, or HTML