Class: Clases::Mensaje
- Inherits:
-
Object
- Object
- Clases::Mensaje
- Defined in:
- lib/imposition/clases.rb
Direct Known Subclasses
MensajeBooklets, MensajeDato, MensajeLadoLado, MensajeMedida, MensajeMultiplo, MensajeTiempo, MensajeVars
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#level ⇒ Object
readonly
Returns the value of attribute level.
-
#mensaje ⇒ Object
readonly
Returns the value of attribute mensaje.
Instance Method Summary collapse
- #==(msg) ⇒ Object
-
#initialize(*args) ⇒ Mensaje
constructor
A new instance of Mensaje.
- #to_s ⇒ Object
Constructor Details
#initialize(*args) ⇒ Mensaje
Returns a new instance of Mensaje.
83 84 85 86 87 88 89 90 |
# File 'lib/imposition/clases.rb', line 83 def initialize(*args) if args.size==1 then @id=args[0] elsif args.size==2 then @level=args[0] #level 1=info, 2=warn, 3=error @mensaje=args[1] end end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
82 83 84 |
# File 'lib/imposition/clases.rb', line 82 def id @id end |
#level ⇒ Object (readonly)
Returns the value of attribute level.
82 83 84 |
# File 'lib/imposition/clases.rb', line 82 def level @level end |
#mensaje ⇒ Object (readonly)
Returns the value of attribute mensaje.
82 83 84 |
# File 'lib/imposition/clases.rb', line 82 def mensaje @mensaje end |
Instance Method Details
#==(msg) ⇒ Object
102 103 104 105 106 107 108 |
# File 'lib/imposition/clases.rb', line 102 def ==(msg) if msg!=nil then return @id==msg.id else return false end end |
#to_s ⇒ Object
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/imposition/clases.rb', line 91 def to_s if @level==1 then @retorno="info: " elsif @level==2 then @retorno="Warn: " elsif @level==3 then @retorno="ERROR: " end @retorno+=@mensaje.to_s return @retorno end |