lib/yinx/note_meta.rb in yinx-0.1.4 vs lib/yinx/note_meta.rb in yinx-0.1.5

- old
+ new

@@ -18,14 +18,10 @@ def initialize meta, note_store @meta = meta @store = note_store end - def self.raw - new nil, nil - end - def tags @tags ||= (tagGuids ? tagGuids.map{|id| @store.tag_name id} : []) end def book @@ -46,9 +42,15 @@ def to_h @h = attr_methods.each_with_object({}) do |method, hash| hash[method] = send method end + end + + def self.from_h hash + raw = new nil, nil + raw.marshal_load hash + raw end def marshal_dump to_h end