Created
April 5, 2009 21:55
-
-
Save michael/90555 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| resource.attributes.each do |attribute| | |
| puts attribute.property.name | |
| puts "--------------------------------" | |
| # there are 4 possible variants | |
| ####################################### | |
| # non-unique value type | |
| # non-unique object type | |
| # unique value type | |
| # unique object type | |
| if attribute.unique? #unique | |
| if attribute.object_type? # unique object | |
| puts attribute.name if attribute.name | |
| else # unique value | |
| puts attribute | |
| end | |
| else # non-unique | |
| if attribute.object_type? # non-unique object type | |
| attribute.each do |resource| | |
| puts resource.name if resource.name | |
| end | |
| else # non-unique value type | |
| attribute.each do |resource| | |
| puts resource if resource | |
| end | |
| end | |
| end | |
| puts # empty line | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment