Class: Clases::MensajeDato

Inherits:
Mensaje
  • Object
show all
Defined in:
lib/imposition/clases.rb

Instance Attribute Summary collapse

Attributes inherited from Mensaje

#id, #level, #mensaje

Instance Method Summary collapse

Methods inherited from Mensaje

#==, #to_s

Constructor Details

#initialize(level, tipo, numero) ⇒ MensajeDato

Returns a new instance of MensajeDato.



115
116
117
118
119
120
121
122
123
# File 'lib/imposition/clases.rb', line 115

def initialize(level,tipo,numero)
    @level=level
    @tipo=tipo
    @numero=numero
    dd=deducirMensaje(tipo,level,numero)
    @id=dd[0]
    @mensaje=dd[1]
    super(level, @mensaje)
end

Instance Attribute Details

#numeroObject (readonly)

Returns the value of attribute numero.



114
115
116
# File 'lib/imposition/clases.rb', line 114

def numero
  @numero
end

#tipoObject (readonly)

Returns the value of attribute tipo.



114
115
116
# File 'lib/imposition/clases.rb', line 114

def tipo
  @tipo
end

Instance Method Details

#deducirMensaje(tipo, level, numero) ⇒ Object



124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/imposition/clases.rb', line 124

def deducirMensaje(tipo, level, numero)
	if tipo=="horizontal" then
		if level==1 then#info
			if numero==1 then
				return [15,I18n.t(:nXCalc)]
			elsif numero==2 then
				return [2,I18n.t(:wPCalc)]
			elsif numero==3 then
				return [12,I18n.t(:wCalc)]
			elsif numero==4 then
				return [1,I18n.t(:wRoyal)]
			end
		elsif level==3 then#error
			if numero==1 then
				return [13,I18n.t(:wOnly)]
			elsif numero==2 then
				return [16,I18n.t(:wPOnly)]
			elsif numero==3 then
				return [17,I18n.t(:nXOnly)]
			elsif numero==4 then
				return [18,I18n.t(:nothingH)]
			elsif numero==5 then
				return [19,I18n.t(:noPageH)]
			end
		end
	elsif tipo=="vertical" then
		if level==1 then#info
			if numero==1 then
				return [20,I18n.t(:nYCalc)]
			elsif numero==2 then
				return [4,I18n.t(:hPCalc)]
			elsif numero==3 then
				return [11,I18n.t(:hCalc)]
			elsif numero==4 then
				return [3,I18n.t(:hRoyal)]
			end
		elsif level==3 then#error
			if numero==1 then
				return [14,I18n.t(:hOnly)]
			elsif numero==2 then
				return [21,I18n.t(:hPOnly)]
			elsif numero==3 then
				return [22,I18n.t(:nYOnly)]
			elsif numero==4 then
				return [23,I18n.t(:nothingV)]
			elsif numero==5 then
				return [24,I18n.t(:noPageV)]
			end
		end
	elsif tipo=="paginas" then
		if level==1 then
			if numero==1 then
				return [25,I18n.t(:nPageCalc)]
			elsif numero==2 then
				return [6,I18n.t(:nSheetCalc)]
			elsif numero==3 then
				return [5,I18n.t(:nPagePdf)]
			end
		elsif level==3 then
			if numero==1 then
				return [26,I18n.t(:nPageXL)]
			else
				return [27,I18n.t(:noPages)]
			end
		end
	elsif tipo=="pliegos" then
		if level==1 then
			return [28,I18n.t(:allSheet, :n=>numero)]
		elsif level==2 then
			return [29,I18n.t(:sheetXL, :n=>numero)]
		elsif level==3 then
			return [30,I18n.t(:sheetXS, :n=>numero)]	
		end
	end

end