Class: Scribo::SiteDrop
- Inherits:
-
ApplicationDrop
- Object
- Liquid::Drop
- ApplicationDrop
- Scribo::SiteDrop
- Defined in:
- app/drops/scribo/site_drop.rb
Overview
Instance Method Summary collapse
-
#categories ⇒ Object
TODO.
- #current_locale ⇒ Object
- #data ⇒ Object
-
#documents ⇒ Object
TODO.
- #html_files ⇒ Object
- #html_pages ⇒ Object
-
#initialize(object) ⇒ SiteDrop
constructor
A new instance of SiteDrop.
- #liquid_method_missing(method) ⇒ Object
- #locale ⇒ Object
- #pages ⇒ Object
- #posts ⇒ Object
-
#related_posts ⇒ Object
TODO.
- #static_files ⇒ Object
-
#tags ⇒ Object
TODO.
- #time ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(object) ⇒ SiteDrop
Returns a new instance of SiteDrop.
10 11 12 13 |
# File 'app/drops/scribo/site_drop.rb', line 10 def initialize(object) @object = object @properties = object.properties end |
Instance Method Details
#categories ⇒ Object
TODO
54 55 56 |
# File 'app/drops/scribo/site_drop.rb', line 54 def categories [] end |
#current_locale ⇒ Object
67 68 69 |
# File 'app/drops/scribo/site_drop.rb', line 67 def current_locale I18n.locale.to_s end |
#data ⇒ Object
44 45 46 |
# File 'app/drops/scribo/site_drop.rb', line 44 def data Scribo::DataDrop.new(@object) end |
#documents ⇒ Object
TODO
49 50 51 |
# File 'app/drops/scribo/site_drop.rb', line 49 def documents [] end |
#html_files ⇒ Object
40 41 42 |
# File 'app/drops/scribo/site_drop.rb', line 40 def html_files @object.contents.html_files.to_a end |
#html_pages ⇒ Object
36 37 38 |
# File 'app/drops/scribo/site_drop.rb', line 36 def html_pages @object.contents.html_pages.to_a end |
#liquid_method_missing(method) ⇒ Object
75 76 77 78 79 80 81 |
# File 'app/drops/scribo/site_drop.rb', line 75 def liquid_method_missing(method) if collections.include?(method) @object.contents.in_folder("_#{method}").order(:created_at).to_a else @properties[method.to_s] end end |
#locale ⇒ Object
71 72 73 |
# File 'app/drops/scribo/site_drop.rb', line 71 def locale @properties['locale'] end |
#pages ⇒ Object
19 20 21 |
# File 'app/drops/scribo/site_drop.rb', line 19 def pages @object.contents.pages.to_a end |
#posts ⇒ Object
23 24 25 |
# File 'app/drops/scribo/site_drop.rb', line 23 def posts @object.contents.posts.sort_by { |p| - p.date.to_i }.to_a end |
#related_posts ⇒ Object
TODO
28 29 30 |
# File 'app/drops/scribo/site_drop.rb', line 28 def [] end |
#static_files ⇒ Object
32 33 34 |
# File 'app/drops/scribo/site_drop.rb', line 32 def static_files @object.contents.assets.to_a end |
#tags ⇒ Object
TODO
59 60 61 |
# File 'app/drops/scribo/site_drop.rb', line 59 def [] end |
#time ⇒ Object
15 16 17 |
# File 'app/drops/scribo/site_drop.rb', line 15 def time Time.current end |
#url ⇒ Object
63 64 65 |
# File 'app/drops/scribo/site_drop.rb', line 63 def url @properties['url'] end |