class Middleman::Tapirgo::SyncableItem
Public Class Methods
new(resource)
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 6 def initialize(resource) @resource = resource end
Public Instance Methods
content()
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 10 def content @resource.render(:layout => nil) end
link()
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 24 def link @resource.path end
published_on()
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 14 def published_on Time.parse(@resource.data['date']) rescue File.mtime(@resource.source_file) end
title()
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 20 def title @resource.data['title'] || @resource.path end
to_hash()
click to toggle source
# File lib/middleman-tapirgo/syncable_item.rb, line 28 def to_hash { :title => title, :content => content, :link => link, :published_on => published_on } end