Class: Page

Inherits:
Object
  • Object
show all
Defined in:
lib/persona/page.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Page

Returns a new instance of Page.



5
6
7
8
9
10
11
# File 'lib/persona/page.rb', line 5

def initialize(name)
  f = File.open("./contents/pages/#{name}.txt","r")
  @content =  f.content_as_string
  @title = f. 'title'
  @author = f. 'author'          
  f.close
end

Instance Attribute Details

#authorObject (readonly)

Returns the value of attribute author.



3
4
5
# File 'lib/persona/page.rb', line 3

def author
  @author
end

#contentObject (readonly)

Returns the value of attribute content.



3
4
5
# File 'lib/persona/page.rb', line 3

def content
  @content
end

#titleObject (readonly)

Returns the value of attribute title.



3
4
5
# File 'lib/persona/page.rb', line 3

def title
  @title
end