Class: Lively::Pages::Index
- Inherits:
-
Object
- Object
- Lively::Pages::Index
- Defined in:
- lib/lively/pages/index.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(title: "Lively", body: "Hello World") ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(title: "Lively", body: "Hello World") ⇒ Index
Returns a new instance of Index.
7 8 9 10 11 12 13 |
# File 'lib/lively/pages/index.rb', line 7 def initialize(title: "Lively", body: "Hello World") @title = title @body = body path = File.("index.trenni", __dir__) @template = Trenni::Template.load_file(path) end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
16 17 18 |
# File 'lib/lively/pages/index.rb', line 16 def body @body end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
15 16 17 |
# File 'lib/lively/pages/index.rb', line 15 def title @title end |
Instance Method Details
#call ⇒ Object
18 19 20 |
# File 'lib/lively/pages/index.rb', line 18 def call @template.to_string(self) end |