add observations to to_h

This commit is contained in:
John Bintz 2011-03-23 12:19:17 -04:00
parent 9cc86289e1
commit df9f763b45
2 changed files with 3 additions and 1 deletions

View File

@ -322,6 +322,7 @@ module AVM
def to_h def to_h
hash = Hash[HASH_FIELDS.collect { |key| [ key, send(key) ] }] hash = Hash[HASH_FIELDS.collect { |key| [ key, send(key) ] }]
hash[:creator] = creator.to_a hash[:creator] = creator.to_a
hash[:observations] = observations.collect(&:to_h)
hash hash
end end

View File

@ -172,7 +172,8 @@ describe AVM::Image do
:metadata_date => Time.parse(metadata_date), :metadata_date => Time.parse(metadata_date),
:metadata_version => metadata_version, :metadata_version => metadata_version,
:subject_names => subject_names, :subject_names => subject_names,
:categories => categories :categories => categories,
:observations => []
} } } }
its(:distance) { should == [ light_years, redshift ] } its(:distance) { should == [ light_years, redshift ] }