Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
40 lines (35 sloc) 1.17 KB
# -*- ruby -*-
#--
# Copyright 2008 Danny Coates, Ashkan Farhadtouski, Peter Wagenet
# All rights reserved.
# See LICENSE for permissions.
#++
# AUTOGENERATED ComplexType
module HealthVault
module WCData
<%- modules.each do |m| -%>
module <%= hv_classify(m) %>
<%- end -%>
class <%= class_name %> < ComplexType
set_tag_name '<%= tag_name %>'
<%- children.each do |child| -%>
<%- # TODO: Handle docs better -%>
<%- if child[:min].to_i > 0 -%>
#<b>REQUIRED</b>
<%- end -%>
<%= child[:doc] %><%= "#<em>value</em> is a #{child[:class]}" %>
<%= "#<b>returns</b>: a #{child[:class]}" %>
<%-
# TODO: Clean this up
method = HealthVault::WCData::Child::TYPES.include?(child[:type].to_s) ? "child_#{child.delete(:type)}" : "child"
params = child.slice(*HealthVault::WCData::Child::PARAMS).sort{|a,b| a.to_s <=> b.to_s }.
map{|(k,v)| ":#{k} => #{v.inspect}"}.join(', ')
-%>
<%= method %> '<%= child[:name] %>', <%= params %>
<%- end -%>
end
<%- modules.length.times do -%>
end
<%- end -%>
end
end