Class: Dropsite::SiteItem

Inherits:
Object
  • Object
show all
Includes:
RenderHelper, Enumerable
Defined in:
lib/dropsite/site_item.rb

Direct Known Subclasses

SiteDir, SiteFile

Instance Attribute Summary collapse

Attributes included from RenderHelper

#rendered_by

Instance Method Summary collapse

Methods included from RenderHelper

#back_link, #each_parent_directory_link_tag, #get_binding, #image_tag, #javascript_include_tag, #link, #page_asset_image_tag, #page_assets_link_base, #parent_dir_name, #parent_directory_link_tag, #plugin_assets_link_base, #stylesheet_link_tag, #url_for

Instance Attribute Details

#pathObject

Returns the value of attribute path.



5
6
7
# File 'lib/dropsite/site_item.rb', line 5

def path
  @path
end

Instance Method Details

#<=>(other) ⇒ Object



15
16
17
# File 'lib/dropsite/site_item.rb', line 15

def <=>(other)
  name <=> other.name
end

#error(msg) ⇒ Object



27
28
29
# File 'lib/dropsite/site_item.rb', line 27

def error(msg)
  @site.error(msg) if @site
end

#nameObject



7
8
9
# File 'lib/dropsite/site_item.rb', line 7

def name
  File.basename @path
end

#notice(msg) ⇒ Object



19
20
21
# File 'lib/dropsite/site_item.rb', line 19

def notice(msg)
  @site.notice(msg) if @site
end

#top_level?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/dropsite/site_item.rb', line 11

def top_level?
  @path.sub(/^\//, '') == name
end

#warning(msg) ⇒ Object



23
24
25
# File 'lib/dropsite/site_item.rb', line 23

def warning(msg)
  @site.warning(msg) if @site
end