Class: File

Inherits:
Object
  • Object
show all
Defined in:
lib/persona/file.rb

Instance Method Summary collapse

Instance Method Details

#content_as_stringObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/persona/file.rb', line 5

def content_as_string
  doc_started = false
  , data = '', ''
  self.each_line do |line|
    doc_started = true if line.chop == ''
    if (doc_started)
      data += line
    else
       +=line
    end
  end
  @metadata = YAML.parse()
  return data
end

#metadata(name) ⇒ Object



20
21
22
# File 'lib/persona/file.rb', line 20

def (name)
  @metadata[name].value
end