Sha256: ee8294158a810814720ff330f4b8362d87302a44108af8800f907a35bd139f15

Contents?: true

Size: 1.23 KB

Versions: 2

Compression:

Stored size: 1.23 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'
  text_node :name, 'name'
  numeric_node :person_id, 'person_id'
  text_node :party, 'party'
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

2 entries across 2 versions & 1 rubygems

Version Path
openaustralia-1.0.1 lib/openaustralia/senators.rb
openaustralia-1.0.0 lib/openaustralia/senators.rb