Module: GreenButtonData::Relations
- Included in:
- Fetchable::ClassMethods
- Defined in:
- lib/green-button-data/relations.rb
Instance Method Summary collapse
-
#construct_related_urls(entry) ⇒ Object
Extracts related URLs from an Entry.
Instance Method Details
#construct_related_urls(entry) ⇒ Object
Extracts related URLs from an Entry
Arguments
-
entry- An instance of GreenButtonData::Parser::Entry
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/green-button-data/relations.rb', line 10 def (entry) = {} entry..each do || match_data = /\/(\w+)(\/(\d+))*$/.match() unless match_data.nil? [:"#{match_data[1].underscore}"] = end end end |