Class: Whisper::Entry

Inherits:
Object
  • Object
show all
Includes:
Dependency, Loggy
Defined in:
lib/whisper/entry.rb

Overview

a blog entry. a text plus a title, basically.

Instance Method Summary collapse

Methods included from Dependency

#content, #dependency_init, #refresh!, #timestamp

Constructor Details

#initialize(meta_file, content_file) ⇒ Entry

Returns a new instance of Entry.



11
12
13
14
# File 'lib/whisper/entry.rb', line 11

def initialize meta_file, content_file
  @text = Text.new meta_file, content_file
  dependency_init
end

Instance Method Details

#body(format, opts = {}) ⇒ Object



27
# File 'lib/whisper/entry.rb', line 27

def body format, opts={}; @text.body format, opts end

#build(old, type) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/whisper/entry.rb', line 18

def build old, type
  case type
    when :html, :rss; build_html_title
    when :txt, :email; build_textile_title
    else raise ArgumentError, "unknown type #{type.inspect}"
  end
end

#dependenciesObject



16
# File 'lib/whisper/entry.rb', line 16

def dependencies; [@text] end

#title(type) ⇒ Object



17
# File 'lib/whisper/entry.rb', line 17

def title type; content type end