Method: ContentsCore::ItemObject#from_string

Defined in:
app/models/contents_core/item_object.rb

#from_string(value) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'app/models/contents_core/item_object.rb', line 13

def from_string( value )
  if value.is_a? String
    val = {}
    value.each_line do |line|
      m = line.match( /([^:]*):(.*)/ )
      val[m[1]] = m[2].strip if m && !m[1].blank?
    end
    self.data_hash = val
  end
end