Module: Diary::Item::Data

Included in:
Page, Post
Defined in:
lib/diary/item/data.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/diary/item/data.rb', line 4

def data
  @data
end

Instance Method Details

#authorObject



15
16
17
# File 'lib/diary/item/data.rb', line 15

def author
  data.author
end

#emailObject



23
24
25
# File 'lib/diary/item/data.rb', line 23

def email
  data.email
end

#initialize(*args) ⇒ Object



6
7
8
9
# File 'lib/diary/item/data.rb', line 6

def initialize(*args)
  super
  load_data
end

#published_atObject



19
20
21
# File 'lib/diary/item/data.rb', line 19

def published_at
  Time.parse(data.published_at)
end

#reload_dataObject



27
28
29
# File 'lib/diary/item/data.rb', line 27

def reload_data
  @data = load_data
end

#titleObject



11
12
13
# File 'lib/diary/item/data.rb', line 11

def title
  data.title
end