Class: Calendario::RenderedYear

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

Overview

A cal-like representation of a year:

                      2020
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

April                  May                   June

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  2      1  2  3  4  5  6
5  6  7  8  9 10 11   3  4  5  6  7  8  9   7  8  9 10 11 12 13

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

              31

July                 August              September

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
5  6  7  8  9 10 11   2  3  4  5  6  7  8   6  7  8  9 10 11 12

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

                30 31

October               November              December

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

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

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(lines) ⇒ RenderedYear

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 year

Parameters:

  • lines (Array<String>)

    List of lines representing a year



53
54
55
# File 'lib/calendario/rendered_year.rb', line 53

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 a year

Returns:

  • (Array<String>)


46
47
48
# File 'lib/calendario/rendered_year.rb', line 46

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 a year

Returns:

  • (String)


62
63
64
# File 'lib/calendario/rendered_year.rb', line 62

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