class Wikicr::Page::Index

Included Modules

Defined in:

lib/page/index.cr
lib/page/index/entry.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class Lockable

load! load!, save! save!, transaction!(read = false, &) transaction!

Constructor Detail

def self.new(ctx : YAML::ParseContext, node : YAML::Nodes::Node) #

[View source]
def self.new(file : String) #

[View source]

Class Method Detail

def self.read(file : String) #

[View source]
def self.url_closeness(from : String, to : String) #

Computes the amount of common chars at the beginning of each string


[View source]

Instance Method Detail

def [](page : Wikicr::Page) : Index::Entry #

Add a new Entry.


[View source]
def []?(page : Wikicr::Page) : Index::Entry | Nil #

Add a new Entry.


[View source]
def add(page : Wikicr::Page) #

Add a new Entry.


[View source]
def delete(page : Wikicr::Page) #

Remove an Entry from the Index based on its path.


[View source]
def entries : Hash(String, Entry) #

[View source]
def entries=(entries : Hash(String, Entry)) #

[View source]
def file : String #

[View source]
def file=(file : String) #

[View source]
def find(text : String, context : Page) : Tuple(String, String) #

Find a matching text into the Index. If no matching content, return a default value.


[View source]
def load! #

Replace the old Index using the state registrated into the file.


[View source]
def save! #

Save the current state into the file


[View source]