Class: UncleKryon::PicData
- Defined in:
- lib/unclekryon/data/pic_data.rb
Instance Attribute Summary collapse
-
#alt ⇒ Object
Returns the value of attribute alt.
-
#caption ⇒ Object
Returns the value of attribute caption.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#mirrors ⇒ Object
Returns the value of attribute mirrors.
-
#name ⇒ Object
Returns the value of attribute name.
-
#url ⇒ Object
Returns the value of attribute url.
Attributes inherited from BaseData
Instance Method Summary collapse
-
#==(other) ⇒ Object
Excludes @updated_on.
-
#initialize ⇒ PicData
constructor
A new instance of PicData.
- #to_s ⇒ Object
Methods inherited from BaseData
#initialize_copy, #max_updated_on, max_updated_on, #max_updated_on_s, max_updated_on_s, #update
Constructor Details
#initialize ⇒ PicData
Returns a new instance of PicData.
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/unclekryon/data/pic_data.rb', line 25 def initialize super() @name = '' @filename = '' @alt = '' @caption = '' @url = '' @mirrors = {} end |
Instance Attribute Details
#alt ⇒ Object
Returns the value of attribute alt.
19 20 21 |
# File 'lib/unclekryon/data/pic_data.rb', line 19 def alt @alt end |
#caption ⇒ Object
Returns the value of attribute caption.
20 21 22 |
# File 'lib/unclekryon/data/pic_data.rb', line 20 def caption @caption end |
#filename ⇒ Object
Returns the value of attribute filename.
17 18 19 |
# File 'lib/unclekryon/data/pic_data.rb', line 17 def filename @filename end |
#mirrors ⇒ Object
Returns the value of attribute mirrors.
23 24 25 |
# File 'lib/unclekryon/data/pic_data.rb', line 23 def mirrors @mirrors end |
#name ⇒ Object
Returns the value of attribute name.
16 17 18 |
# File 'lib/unclekryon/data/pic_data.rb', line 16 def name @name end |
#url ⇒ Object
Returns the value of attribute url.
22 23 24 |
# File 'lib/unclekryon/data/pic_data.rb', line 22 def url @url end |
Instance Method Details
#==(other) ⇒ Object
Excludes @updated_on
39 40 41 42 43 44 45 46 |
# File 'lib/unclekryon/data/pic_data.rb', line 39 def ==(other) return @name == other.name && @filename == other.filename && @alt == other.alt && @caption == other.caption && @url == other.url && @mirrors == other.mirrors end |
#to_s ⇒ Object
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/unclekryon/data/pic_data.rb', line 48 def to_s s = ''.dup if @name.empty? || @name.strip.empty? s << ('%-100s' % [@url]) else s << ('%-30s' % [@name]) s << (' | %30s' % [@filename]) unless @name == @filename s << (' | %30s' % [@alt]) unless @name == @alt s << (' | %60s' % [@caption]) end return s end |