Class: Blogy::Post::Translation

Inherits:
ActiveRecord::Base
  • Object
show all
Extended by:
Enumerize
Defined in:
app/models/blogy/post/translation.rb

Instance Method Summary collapse

Instance Method Details

#contentObject



9
10
11
# File 'app/models/blogy/post/translation.rb', line 9

def content
  formated
end

#formatedObject



13
14
15
16
17
18
19
20
# File 'app/models/blogy/post/translation.rb', line 13

def formated
  case format.to_sym
  when :plain, :html
    value
  when :markdown
    markdown
  end
end

#valueObject



22
23
24
25
26
27
28
29
30
31
32
# File 'app/models/blogy/post/translation.rb', line 22

def value
  case storage.to_sym
  when :text
    text
  when :document
    # TODO
    # document.file.read if document?
  when :remote
    open(remote).read if remote?
  end
end