DocumentDrop: use def_delegators instead of duplicating methods

This commit is contained in:
Parker Moore 2015-12-21 23:36:31 -05:00
parent ebe3c10604
commit 03488b1cde
1 changed files with 2 additions and 14 deletions

View File

@ -3,18 +3,10 @@
module Jekyll module Jekyll
module Drops module Drops
class DocumentDrop < ImmutableDrop class DocumentDrop < ImmutableDrop
extend Forwardable
def output def_delegators :@obj, :id, :output, :content, :to_s, :relative_path, :url
@obj.output
end
def content
@obj.content
end
def relative_path
@obj.relative_path
end
alias_method :path, :relative_path alias_method :path, :relative_path
def url def url
@ -33,10 +25,6 @@ module Jekyll
@obj.previous_doc @obj.previous_doc
end end
def id
@obj.id
end
def excerpt def excerpt
fallback_data['excerpt'].to_s fallback_data['excerpt'].to_s
end end