class Bunto::Drops::UrlDrop

Public Instance Methods

categories() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 30
def categories
  category_set = Set.new
  Array(@obj.data["categories"]).each do |category|
    category_set << category.to_s.downcase
  end
  category_set.to_a.join("/")
end
collection() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 13
def collection
  @obj.collection.label
end
day() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 46
def day
  @obj.date.strftime("%d")
end
hour() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 50
def hour
  @obj.date.strftime("%H")
end
i_day() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 62
def i_day
  @obj.date.strftime("%-d")
end
i_month() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 66
def i_month
  @obj.date.strftime("%-m")
end
minute() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 54
def minute
  @obj.date.strftime("%M")
end
month() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 42
def month
  @obj.date.strftime("%m")
end
name() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 17
def name
  Utils.slugify(@obj.basename_without_ext)
end
second() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 58
def second
  @obj.date.strftime("%S")
end
short_month() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 70
def short_month
  @obj.date.strftime("%b")
end
short_year() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 74
def short_year
  @obj.date.strftime("%y")
end
slug() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 26
def slug
  Utils.slugify(@obj.data["slug"]) || Utils.slugify(@obj.basename_without_ext)
end
title() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 21
def title
  Utils.slugify(@obj.data["slug"], :mode => "pretty", :cased => true) ||
    Utils.slugify(@obj.basename_without_ext, :mode => "pretty", :cased => true)
end
y_day() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 78
def y_day
  @obj.date.strftime("%j")
end
year() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 38
def year
  @obj.date.strftime("%Y")
end

Private Instance Methods

fallback_data() click to toggle source
# File lib/bunto/drops/url_drop.rb, line 83
def fallback_data
  {}
end