ad a preliminary syntax for class objects, which is just the class name

This commit is contained in:
Torsten Ruger 2014-08-19 23:01:19 +03:00
parent a7dc60e638
commit 52ca7110c3
2 changed files with 7 additions and 0 deletions

View File

@ -31,6 +31,9 @@ module Sof
end
def object_sof_node( object , level , ref)
if( object.is_a? Class )
return SimpleNode.new( object.name )
end
head = object.class.name + "("
atts = attributes_for(object).inject({}) do |hash , a|
val = get_value(object , a)

View File

@ -86,4 +86,8 @@ class BasicSof < MiniTest::Test
@out = Sof::Writer.write(object)
check "&1 ObjectWithAttributes(:name => 'some name', :number => 1234, :extra => *1)"
end
def test_class
@out = Sof::Writer.write(ObjectWithAttributes)
check "ObjectWithAttributes"
end
end