Class: Jekyll::Commands::PostMovementInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/commands/unpublish.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ PostMovementInfo

Returns a new instance of PostMovementInfo.



48
49
50
# File 'lib/jekyll/commands/unpublish.rb', line 48

def initialize(params)
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



47
48
49
# File 'lib/jekyll/commands/unpublish.rb', line 47

def params
  @params
end

Instance Method Details

#fromObject



52
53
54
# File 'lib/jekyll/commands/unpublish.rb', line 52

def from
  params.path
end

#front_matter(data) ⇒ Object



60
61
62
# File 'lib/jekyll/commands/unpublish.rb', line 60

def front_matter(data)
  data.reject { |key, _value| key == "date" }
end

#toObject



56
57
58
# File 'lib/jekyll/commands/unpublish.rb', line 56

def to
  "_drafts/#{params.name}"
end