Class: Calendario::RenderedInterval

Inherits:
Object
  • Object
show all
Defined in:
lib/calendario/rendered_interval.rb

Overview

A cal-like representation of an interval:

January               February               March

Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa

         1  2  3  4                     1   1  2  3  4  5  6  7
5  6  7  8  9 10 11   2  3  4  5  6  7  8   8  9 10 11 12 13 14

12 13 14 15 16 17 18 9 10 11 12 13 14 15 15 16 17 18 19 20 21 19 20 21 22 23 24 25 16 17 18 19 20 21 22 22 23 24 25 26 27 28 26 27 28 29 30 31 23 24 25 26 27 28 29 29 30 31

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ RenderedInterval

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Initializes a rendered interval



25
26
27
# File 'lib/calendario/rendered_interval.rb', line 25

def initialize(lines)
  @lines = lines
end

Instance Attribute Details

#linesArray<String> (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

A list of lines representing an interval



18
19
20
# File 'lib/calendario/rendered_interval.rb', line 18

def lines
  @lines
end

Instance Method Details

#to_sString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns the textual representation of an interval



34
35
36
# File 'lib/calendario/rendered_interval.rb', line 34

def to_s
  lines.join("\n")
end