lib/sax-machine/sax_document.rb in astro-sax-machine-0.0.16 vs lib/sax-machine/sax_document.rb in astro-sax-machine-0.0.17
- old
+ new
@@ -41,14 +41,18 @@
attr_reader options[:as] unless instance_methods.include?(options[:as].to_s)
attr_writer_once options[:as] unless instance_methods.include?("#{options[:as]}=")
end
def columns
- sax_config.top_level_elements
+ r = []
+ sax_config.top_level_elements.each do |name, ecs|
+ r += ecs
+ end
+ r
end
def column(sym)
- columns.select{|c| c.column == sym}[0]
+ sax_config.top_level_elements[sym.to_s][0]
end
def data_class(sym)
column(sym).data_class
end