Module HomePageModule
In: lib/modules/home_page_module.rb

Methods

Classes and Modules

Module HomePageModule::ClassMethods

Public Class methods

[Source]

    # File lib/modules/home_page_module.rb, line 29
29:   def self.included(base)
30:     base.extend(ClassMethods)
31:     base.send(:initialize_module)
32:   end

Public Instance methods

Returns all homepages.

[Source]

    # File lib/modules/home_page_module.rb, line 44
44:   def all_home_pages_for(role_tag)
45:     l = self.home_page_link_for(role_tag)
46:     l.resolve(:force => true)
47:     return l.volatile_all_logis
48:   end

Creates a home-page containing the text, belonging to the user, and accessible under role_tag/self.home_page_tag.

Also sets the home_page_tag of the object.

[Source]

    # File lib/modules/home_page_module.rb, line 77
77:   def create_home_page_for(role_tag, options = {})
78:     i = Logi.new_with(options)
79:     i.tag_with_link(Link.new(:requested_tags => [self.home_page_tag, role_tag]))
80:     i.save
81:   end

Destroys the home-pages.

(all pages under role_tag/self.name, judging their main_link)

MAYDO add to qeue so logis added just before destroying are not missed because not yet in index, low priority.

[Source]

    # File lib/modules/home_page_module.rb, line 66
66:   def destroy_home_pages_for(role_tag)
67:     self.all_home_pages_for(role_tag).each do |i|
68:       i.destroy
69:     end
70:   end

Returns the home_page for this object.

[Source]

    # File lib/modules/home_page_module.rb, line 52
52:   def home_page_for(role_tag)
53:     l = self.home_page_link_for(role_tag)
54:     l.resolve(:force => true) # are exact matches
55:     return l.volatile_to_logi
56:   end

Returns the home page link, resolved and well.

[Source]

    # File lib/modules/home_page_module.rb, line 38
38:   def home_page_link_for(role_tag)
39:     return Link.new(:requested_tags => [self.home_page_tag, role_tag])
40:   end

sets the home_page_tag of the object, based on it‘s name.

[Source]

    # File lib/modules/home_page_module.rb, line 87
87:   def set_home_page_tag
88:     begin
89:       self.home_page_tag = Tag.from_s(self.name)
90:     rescue
91:       self.errors.add(:tag, "invalid tag")
92:     end
93:   end

[Validate]