Class: Blogical::Content::Article

Inherits:
Object
  • Object
show all
Defined in:
app/blogical/content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(meta) ⇒ Article

Returns a new instance of Article.



78
79
80
81
# File 'app/blogical/content.rb', line 78

def initialize(meta)
  @path, @content = meta, File.join(File.expand_path(File.dirname(meta)), 'content.markdown')
  instance_eval File.read(meta)
end

Instance Attribute Details

#attachments(*attachments) ⇒ Object

Returns the value of attribute attachments.



76
77
78
# File 'app/blogical/content.rb', line 76

def attachments
  @attachments
end

#contentObject

Returns the value of attribute content.



76
77
78
# File 'app/blogical/content.rb', line 76

def content
  @content
end

Returns the value of attribute permalink.



76
77
78
# File 'app/blogical/content.rb', line 76

def permalink
  @permalink
end

#posted(date = nil) ⇒ Object

Returns the value of attribute posted.



76
77
78
# File 'app/blogical/content.rb', line 76

def posted
  @posted
end

#tags(*tags) ⇒ Object

Returns the value of attribute tags.



76
77
78
# File 'app/blogical/content.rb', line 76

def tags
  @tags
end

#titleObject

Returns the value of attribute title.



76
77
78
# File 'app/blogical/content.rb', line 76

def title
  @title
end

Instance Method Details

#article(title, &block) ⇒ Object



83
84
85
86
# File 'app/blogical/content.rb', line 83

def article(title, &block)
  @title = title
  instance_eval &block
end

#emailObject



106
107
108
# File 'app/blogical/content.rb', line 106

def email
  Blogical::Application.email
end

#nicknameObject

REVISIT: most recent content file git commit author



102
103
104
# File 'app/blogical/content.rb', line 102

def nickname
  Blogical::Application.nickname
end

#urlObject



110
111
112
# File 'app/blogical/content.rb', line 110

def url
  "/blog/#{@posted}/#{@permalink}"
end