README.md in puree-2.1.1 vs README.md in puree-2.2.0
- old
+ new
@@ -31,19 +31,29 @@
api_key: 'YOUR_API_KEY'
}
```
## Extractor module
-Find a resource by identifier and get Ruby objects.
-
```ruby
-# Configure an extractor
+# Configure an extractor for a resource
extractor = Puree::Extractor::Dataset.new config
```
```ruby
-# Fetch the metadata for a resource with a particular identifier
+# Find out how many records are available
+extractor.count
+#=> 1000
+```
+
+```ruby
+# Fetch a random record
+extractor.random
+#=> #<Puree::Model::Dataset:0x00c0ffee>
+```
+
+```ruby
+# Fetch the metadata for a record with a particular identifier
dataset = extractor.find 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
#=> #<Puree::Model::Dataset:0x00c0ffee>
```
```ruby
@@ -59,11 +69,11 @@
```
## XMLExtractor module
Get Ruby objects from Pure XML.
-### Single resource
+### Single record
```ruby
xml = '<project> ... </project>'
```
```ruby
@@ -81,11 +91,11 @@
# Get all the metadata together
xml_extractor.model
#=> #<Puree::Model::Project:0x00c0ffee>
```
-### Homogeneous resource collection
+### Homogeneous record collection
```ruby
xml = '<result>
<dataSet> ... </dataSet>
<dataSet> ... </dataSet>
...
@@ -96,10 +106,10 @@
# Get an array of datasets
Puree::XMLExtractor::Collection.datasets xml
#=> [#<Puree::Model::Dataset:0x00c0ffee>, ...]
```
-### Heterogeneous resource collection
+### Heterogeneous record collection
```ruby
xml = '<result>
<contributionToJournal> ... </contributionToJournal>
<contributionToConference> ... </contributionToConference>
...
\ No newline at end of file