Class: UncleKryon::ReleaseData

Inherits:
BaseData
  • Object
show all
Defined in:
lib/unclekryon/data/release_data.rb

Instance Attribute Summary collapse

Attributes inherited from BaseData

#updated_on

Instance Method Summary collapse

Methods inherited from BaseData

#initialize_copy, #max_updated_on, max_updated_on, #max_updated_on_s, max_updated_on_s, #update

Constructor Details

#initializeReleaseData

Returns a new instance of ReleaseData.



23
24
25
26
27
28
29
30
31
32
# File 'lib/unclekryon/data/release_data.rb', line 23

def initialize
  super()

  @title = ''

  @url = ''
  @mirrors = {}

  @albums = []
end

Instance Attribute Details

#albumsObject

Returns the value of attribute albums.



21
22
23
# File 'lib/unclekryon/data/release_data.rb', line 21

def albums
  @albums
end

#mirrorsObject

Returns the value of attribute mirrors.



19
20
21
# File 'lib/unclekryon/data/release_data.rb', line 19

def mirrors
  @mirrors
end

#titleObject

Returns the value of attribute title.



16
17
18
# File 'lib/unclekryon/data/release_data.rb', line 16

def title
  @title
end

#urlObject

Returns the value of attribute url.



18
19
20
# File 'lib/unclekryon/data/release_data.rb', line 18

def url
  @url
end

Instance Method Details

#to_mini_sObject



34
35
36
# File 'lib/unclekryon/data/release_data.rb', line 34

def to_mini_s
  return to_s(true)
end

#to_s(mini = false) ⇒ Object



38
39
40
41
42
43
# File 'lib/unclekryon/data/release_data.rb', line 38

def to_s(mini=false)
  s = ''
  s << ('%-10s' % [@title])
  s << (mini ? (' | %3d' % [@albums.length]) : ("\n- " << @albums.join("\n- ")))
  return s
end