2023-02-19 20:53:39 +00:00
|
|
|
local Object = require 'nature.object'
|
|
|
|
|
|
|
|
local Page = Object:extend()
|
|
|
|
|
2023-07-10 02:38:34 +00:00
|
|
|
function Page:new(title, text)
|
2023-02-19 20:53:39 +00:00
|
|
|
self:setText(text)
|
2023-07-10 02:38:34 +00:00
|
|
|
self.title = title or 'Page'
|
2023-02-19 20:53:39 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
function Page:setText(text)
|
|
|
|
self.lines = string.split(text, '\n')
|
|
|
|
end
|
|
|
|
|
2023-07-10 02:38:34 +00:00
|
|
|
function Page:setTitle(title)
|
|
|
|
self.title = title
|
|
|
|
end
|
|
|
|
|
2023-02-19 20:53:39 +00:00
|
|
|
return Page
|