Class: Hotchoc::Post
- Inherits:
-
Base
- Object
- Base
- Hotchoc::Post
show all
- Defined in:
- lib/hotchoc/post.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
#blocks ⇒ Object
27
28
29
|
# File 'lib/hotchoc/post.rb', line 27
def blocks
@item['blocks'].to_a.map { |block| block_for(block) }
end
|
#created_at ⇒ Object
35
36
37
|
# File 'lib/hotchoc/post.rb', line 35
def created_at
Time.parse(@item['created_at'])
end
|
#id ⇒ Object
3
4
5
|
# File 'lib/hotchoc/post.rb', line 3
def id
@item['id']
end
|
#identifier ⇒ Object
15
16
17
|
# File 'lib/hotchoc/post.rb', line 15
def identifier
@item['identifier']
end
|
#inspect ⇒ Object
43
44
45
|
# File 'lib/hotchoc/post.rb', line 43
def inspect
%(#<Hotchoc::Post: title="#{title}">)
end
|
#publish_date ⇒ Object
23
24
25
|
# File 'lib/hotchoc/post.rb', line 23
def publish_date
Time.parse(@item['publish_date'])
end
|
#status ⇒ Object
19
20
21
|
# File 'lib/hotchoc/post.rb', line 19
def status
@item['status']
end
|
#subtitle ⇒ Object
11
12
13
|
# File 'lib/hotchoc/post.rb', line 11
def subtitle
@item['subtitle']
end
|
#title ⇒ Object
7
8
9
|
# File 'lib/hotchoc/post.rb', line 7
def title
@item['title']
end
|
#topics ⇒ Object
31
32
33
|
# File 'lib/hotchoc/post.rb', line 31
def topics
@item['topics'].to_a.map { |topic| Hotchoc::Topic.new(topic) }
end
|
#updated_at ⇒ Object
39
40
41
|
# File 'lib/hotchoc/post.rb', line 39
def updated_at
Time.parse(@item['updated_at'])
end
|