Class: Hotchoc::Album

Inherits:
Base
  • Object
show all
Defined in:
lib/hotchoc/album.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



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

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

#coverObject



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

def cover
  @item['cover'] ? block_for(@item['cover']) : nil
end

#created_atObject



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

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

#descriptionObject



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

def description
  @item['description']
end

#idObject



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

def id
  @item['id']
end

#identifierObject



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

def identifier
  @item['identifier']
end

#inspectObject



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

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

#publish_dateObject



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

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

#statusObject



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

def status
  @item['status']
end

#subtitleObject



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

def subtitle
  @item['subtitle']
end

#titleObject



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

def title
  @item['title']
end

#topicsObject



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

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

#updated_atObject



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

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