Class: Hotchoc::Page

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

Instance Attribute Summary

Attributes inherited from Base

#item

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Hotchoc::Base

Instance Method Details

#blocksObject



43
44
45
# File 'lib/hotchoc/page.rb', line 43

def blocks
  @item['blocks'].to_a.map { |block| block_for(block) }
end

#created_atObject



51
52
53
# File 'lib/hotchoc/page.rb', line 51

def created_at
  Time.parse(@item['created_at'])
end

#idObject



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

def id
  @item['id']
end

#identifierObject



15
16
17
# File 'lib/hotchoc/page.rb', line 15

def identifier
  @item['identifier']
end

#inspectObject



59
60
61
# File 'lib/hotchoc/page.rb', line 59

def inspect
  %(#<Hotchoc::Page: title="#{title}">)
end

#levelObject



35
36
37
# File 'lib/hotchoc/page.rb', line 35

def level
  @item['level']
end

#parent_idObject



27
28
29
# File 'lib/hotchoc/page.rb', line 27

def parent_id
  @item['parent_id']
end

#pathObject



23
24
25
# File 'lib/hotchoc/page.rb', line 23

def path
  @item['path']
end

#positionObject



31
32
33
# File 'lib/hotchoc/page.rb', line 31

def position
  @item['position']
end

#publish_dateObject



39
40
41
# File 'lib/hotchoc/page.rb', line 39

def publish_date
  Time.parse(@item['publish_date'])
end

#statusObject



19
20
21
# File 'lib/hotchoc/page.rb', line 19

def status
  @item['status']
end

#subtitleObject



11
12
13
# File 'lib/hotchoc/page.rb', line 11

def subtitle
  @item['subtitle']
end

#titleObject



7
8
9
# File 'lib/hotchoc/page.rb', line 7

def title
  @item['title']
end

#topicsObject



47
48
49
# File 'lib/hotchoc/page.rb', line 47

def topics
  @item['topics'].to_a.map { |topic| Hotchoc::Topic.new(topic) }
end

#updated_atObject



55
56
57
# File 'lib/hotchoc/page.rb', line 55

def updated_at
  Time.parse(@item['updated_at'])
end