Sha256: 02016cd9d668319225e0e1f9fb8e20851e73c4c8ab874dfd44a41cad50a62e88
Contents?: true
Size: 1.61 KB
Versions: 1
Compression:
Stored size: 1.61 KB
Contents
# XML mapping objects for OA queries # relating to senators require 'xml/mapping' module OpenAustralia #search result for an individual senator class Senator include XML::Mapping numeric_node :member_id, 'member_id' numeric_node :house, 'house' text_node :first_name, 'first_name' text_node :last_name, 'last_name' text_node :constituency, 'constituency' text_node :party, 'party' text_node :entered_house, 'entered_house' text_node :entered_reason, 'entered_reason' text_node :left_house, 'left_house' text_node :left_reason, 'left_reason' numeric_node :person_id, 'person_id' text_node :title, 'title' text_node :full_name, 'full_name' end # record for foresults of a representative search class SenatorResult include XML::Mapping array_node :matches, "result", "match", :class=>Senator, :default_value=>[] end # search results for a list of senators class SenatorFound include XML::Mapping numeric_node :member_id, 'member_id' numeric_node :house, 'house' text_node :first_name, 'first_name' text_node :last_name, 'last_name' text_node :constituency, 'constituency' text_node :party, 'party' text_node :entered_house, 'entered_house' text_node :entered_reason, 'entered_reason' text_node :left_house, 'left_house' text_node :left_reason, 'left_reason' numeric_node :person_id, 'person_id' text_node :title, 'title' text_node :full_name, 'full_name' text_node :name, 'name' end # record for foresults of a representative search class SenatorSearchResult include XML::Mapping array_node :matches, "result", "match", :class=>SenatorFound, :default_value=>[] end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openaustralia-1.0.2 | lib/openaustralia/senators.rb |