lib/dashcode-converter/nib/view.rb in dashcode-converter-0.0.1 vs lib/dashcode-converter/nib/view.rb in dashcode-converter-0.1.0
- old
+ new
@@ -10,16 +10,15 @@
EOF
attr_reader :name, :nib, :items, :items_by_id
attr_accessor :is_template
- def initialize(name, spec, nib)
+ def initialize(name, nib)
@name= name
@nib= nib
@items= []
@items_by_id= {}
- from_spec(spec) if spec
end
def remove_item(item)
@items_by_id.delete(item.name)
@items.delete(item)
@@ -29,12 +28,13 @@
item.view= self
@items_by_id[item.name]= item
@items << item
end
- def from_spec(spec)
+ def parse_spec(spec)
spec.each { |id, part_spec|
- item= NibItem.new("##{id}", part_spec, nib)
+ item= NibItem.new("##{id}", nib)
+ item.parse_spec(part_spec)
add_item(item)
}
end
def declaration
\ No newline at end of file