Class: RTV::Show
- Inherits:
-
Object
- Object
- RTV::Show
- Defined in:
- lib/rtv.rb
Constant Summary collapse
- Filler =
"\t"
Instance Attribute Summary collapse
-
#channel ⇒ Object
Returns the value of attribute channel.
-
#date ⇒ Object
Returns the value of attribute date.
-
#desc ⇒ Object
Returns the value of attribute desc.
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#showview ⇒ Object
Returns the value of attribute showview.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
Instance Attribute Details
#channel ⇒ Object
Returns the value of attribute channel.
67 68 69 |
# File 'lib/rtv.rb', line 67 def channel @channel end |
#date ⇒ Object
Returns the value of attribute date.
67 68 69 |
# File 'lib/rtv.rb', line 67 def date @date end |
#desc ⇒ Object
Returns the value of attribute desc.
67 68 69 |
# File 'lib/rtv.rb', line 67 def desc @desc end |
#name ⇒ Object
Returns the value of attribute name.
67 68 69 |
# File 'lib/rtv.rb', line 67 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
67 68 69 |
# File 'lib/rtv.rb', line 67 def @options end |
#showview ⇒ Object
Returns the value of attribute showview.
67 68 69 |
# File 'lib/rtv.rb', line 67 def showview @showview end |
#time ⇒ Object
Returns the value of attribute time.
67 68 69 |
# File 'lib/rtv.rb', line 67 def time @time end |
Instance Method Details
#to_a ⇒ Object
84 85 86 87 88 |
# File 'lib/rtv.rb', line 84 def to_a tmp = [@channel, @date, @time, @name] tmp << @desc if @options[:desc] tmp end |
#to_s(*lastshow) ⇒ Object
71 72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/rtv.rb', line 71 def to_s *lastshow if @options[:redundanz] self.to_a.compact.join(Filler) else lastshow = if lastshow.first.nil? [()] * to_a.size else lastshow.first end self.to_a.zip(lastshow.to_a).map{|x,y| (x == y) ? (' ' * x.to_s.size) : x}.reject{|x| x.empty?}.join(Filler) end end |