Class: Lively::Pages::Index

Inherits:
Object
  • Object
show all
Defined in:
lib/lively/pages/index.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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.expand_path("index.trenni", __dir__)
	@template = Trenni::Template.load_file(path)
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



16
17
18
# File 'lib/lively/pages/index.rb', line 16

def body
  @body
end

#titleObject (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

#callObject



18
19
20
# File 'lib/lively/pages/index.rb', line 18

def call
	@template.to_string(self)
end