lib/termnote/loader.rb in termnote-1.0.0 vs lib/termnote/loader.rb in termnote-1.1.0
- old
+ new
@@ -11,15 +11,10 @@
end
def to_panes
@documents.map do |document|
type = document['type']
- case type
- when "chapter" then Pane::Chapter.new document
- when "code" then Pane::Code.new document
- when "list" then Pane::List.new document
- when "text" then Pane::Text.new document
- end
+ send(type, document)
end
end
end
end