Module: WeatherCard::InstanceMethods
- Included in:
- FiveLines, Hourly, SevenLines
- Defined in:
- lib/concerns/weathercard.rb
Instance Method Summary collapse
- #initialize(day) ⇒ Object
- #line_end ⇒ Object
- #line_intermediate(value) ⇒ Object
- #return_spaces(length) ⇒ Object
Instance Method Details
#initialize(day) ⇒ Object
10 11 12 13 |
# File 'lib/concerns/weathercard.rb', line 10 def initialize(day) self.day = day self.class.all << self end |
#line_end ⇒ Object
19 20 21 |
# File 'lib/concerns/weathercard.rb', line 19 def line_end self.class.horizontal * (self.class.length + 2) end |
#line_intermediate(value) ⇒ Object
23 24 25 |
# File 'lib/concerns/weathercard.rb', line 23 def line_intermediate(value) "#{self.class.vertical}#{value}#{self.class.vertical}" end |
#return_spaces(length) ⇒ Object
15 16 17 |
# File 'lib/concerns/weathercard.rb', line 15 def return_spaces(length) ' ' * (self.class.length - length) end |