Module: CalendariumRomanum::ValueObjectInterface

Included in:
Colour, Season
Defined in:
lib/calendarium-romanum/enums.rb

Overview

Methods shared by most value objects defined by the gem

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#symbolSymbol (readonly) Also known as: to_sym

Machine-readable internal representation of the value

Returns:

  • (Symbol)


7
8
9
# File 'lib/calendarium-romanum/enums.rb', line 7

def symbol
  @symbol
end

Instance Method Details

#nameString

Internationalized, human-readable name

Returns:

  • (String)


13
14
15
# File 'lib/calendarium-romanum/enums.rb', line 13

def name
  I18n.t @i18n_key
end

#to_sString

String representation of the contents for debugging purposes

Returns:

  • (String)


20
21
22
# File 'lib/calendarium-romanum/enums.rb', line 20

def to_s
  "#<#{self.class.name} #{symbol}>"
end