class Wikicr::Page::Index
- Wikicr::Page::Index
- Lockable
- Reference
- Object
Included Modules
- YAML::Serializable
Defined in:
lib/page/index.crlib/page/index/entry.cr
Constructors
Class Method Summary
- .read(file : String)
-
.url_closeness(from : String, to : String)
Computes the amount of common chars at the beginning of each string
Instance Method Summary
-
#[](page : Wikicr::Page) : Index::Entry
Add a new
Entry
. -
#[]?(page : Wikicr::Page) : Index::Entry | Nil
Add a new
Entry
. -
#add(page : Wikicr::Page)
Add a new
Entry
. - #delete(page : Wikicr::Page)
- #entries : Hash(String, Entry)
- #entries=(entries : Hash(String, Entry))
- #file : String
- #file=(file : String)
-
#find(text : String, context : Page) : Tuple(String, String)
Find a matching text into the Index.
-
#load!
Replace the old Index using the state registrated into the file.
-
#save!
Save the current state into the file
Instance methods inherited from class Lockable
load!
load!,
save!
save!,
transaction!(read = false, &)
transaction!
Constructor Detail
Class Method Detail
def self.url_closeness(from : String, to : String)
#
Computes the amount of common chars at the beginning of each string
Instance Method Detail
Find a matching text into the Index. If no matching content, return a default value.